fix:relative url handle

This commit is contained in:
yifang 2022-01-02 09:37:43 +08:00
parent 47faab5a52
commit d5af210785

View file

@ -2,6 +2,10 @@
$(function() { $(function() {
$("a").click(function(event) { $("a").click(function(event) {
var link = $(this).attr("href"); var link = $(this).attr("href");
if(link.indexOf("://")>=0){
return;
}
var newLink; var newLink;
if (link.startsWith("#")) { if (link.startsWith("#")) {
newLink = window.location.href + link; newLink = window.location.href + link;