fix: relative url with gdanchor parameter

This commit is contained in:
YiFang Xiao 2022-03-30 00:20:49 +08:00
parent 5406551b57
commit 9b1f25f3f4

View file

@ -27,14 +27,19 @@ $(function() {
} }
} else { } else {
index = href.indexOf("?"); index = href.indexOf("?");
if(index>-1)
{ if (link.indexOf("?gdanchor") > -1) {
newLink = "gdlookup://localhost/" + link;
}
else {
if (index > -1) {
newLink = href.substring(0, index) + "?word=" + link; newLink = href.substring(0, index) + "?word=" + link;
} }
else { else {
newLink = href + "?word=" + link; newLink = href + "?word=" + link;
} }
} }
}
$(this).attr("href", newLink); $(this).attr("href", newLink);
}); });