From 6e021dd01984cc6a7bcd96d6967e2364291e0559 Mon Sep 17 00:00:00 2001 From: Philipp Hemmelmayr Date: Sat, 13 Apr 2019 00:45:49 +0200 Subject: [PATCH 1/2] ignore javascript href --- ldf.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ldf.js b/ldf.js index 5536940..62da766 100644 --- a/ldf.js +++ b/ldf.js @@ -8,6 +8,9 @@ var ldf = { end: undefined, hash: true, nav: function (location) { + if (location.startsWith("javascript:")) { + return; + } if (ldf.hash && !location.startsWith("#")) { location = "#" + location; if (location == "#/") { From 14dfecc4ee633b6863e135ccd67b1d81f2625030 Mon Sep 17 00:00:00 2001 From: Philipp Hemmelmayr Date: Sat, 13 Apr 2019 01:23:04 +0200 Subject: [PATCH 2/2] fixed notfound behavior --- ldf.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ldf.js b/ldf.js index 62da766..5897bc6 100644 --- a/ldf.js +++ b/ldf.js @@ -42,7 +42,7 @@ var ldf = { loc += document.location.search || ""; } ldf.helpers.request(loc, function (succ, content) { - if (succ && ldf.notfound !== undefined) { + if (succ || ldf.notfound == undefined) { ldf.change(selector, content); } else { ldf.change(selector, ldf.notfound);