mirror of
https://github.com/pattern-lab/patternlab-php.git
synced 2025-02-19 23:14:38 +01:00
Links with no href attribute shouldn't cause a 404
A 3rd party script I'm using [Chosen](http://harvesthq.github.io/chosen/) generates an `a` element without a `href` attribute, which causes a 404 when clicked unless we check for `href.length` in the onclick handler.
This commit is contained in:
parent
ff31431333
commit
09c2867819
@ -32,7 +32,7 @@ if (self != top) {
|
|||||||
aTags[i].onclick = function(e) {
|
aTags[i].onclick = function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
var href = this.getAttribute("href");
|
var href = this.getAttribute("href");
|
||||||
if (href != "#") {
|
if (href.length && href !== "#") {
|
||||||
window.location.replace(href);
|
window.location.replace(href);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user