diff --git a/resources/gd_custom.js b/resources/gd_custom.js index 69e4742f..aaf0e423 100644 --- a/resources/gd_custom.js +++ b/resources/gd_custom.js @@ -2,12 +2,18 @@ $(function() { $("a").click(function(event) { var link = $(this).attr("href"); - if (link.indexOf("://") < 0) { - var newLink = window.location.href + "/" + link; - $(this).attr("href", newLink); + 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); + }); } -); \ No newline at end of file +);