Links are considered external in IE(9 to 11) and then trigger a reload. location.protocol and location.hostname are empty in case of a relative URL.
This function seems to fix it. (Layout.prototype.isExternalLink)
function getLocation(href) {
var location = document.createElement("a");
location.href = href;
// IE doesn't populate all link properties when setting .href with a relative URL,
// however .href will return an absolute URL which then can be used on itself
// to populate these additional fields.
if (location.host == "") {
location.href = location.href;
}
return location;
};
Links are considered external in IE(9 to 11) and then trigger a reload. location.protocol and location.hostname are empty in case of a relative URL.
This function seems to fix it. (
Layout.prototype.isExternalLink
)source: http://stackoverflow.com/questions/736513/how-do-i-parse-a-url-into-hostname-and-path-in-javascript