mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-24 12:44:07 +00:00
c01257d592
bword:xxxx link handle
28 lines
681 B
JavaScript
28 lines
681 B
JavaScript
//document ready ,
|
|
$(function() {
|
|
$("a").click(function(event) {
|
|
var link = $(this).attr("href");
|
|
if(link.indexOf(":")>=0){
|
|
return;
|
|
}
|
|
|
|
var newLink;
|
|
if (link.startsWith("#")) {
|
|
newLink = window.location.href + link;
|
|
} else {
|
|
var href = window.location.href;
|
|
var index = href.indexOf("?");
|
|
newLink = href.substring(0, index) + "?word=" + link;
|
|
}
|
|
$(this).attr("href", newLink);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
);
|
|
function playSound(sound) {
|
|
var a = new Audio(sound);
|
|
a.play();
|
|
}
|