Fix JS error when a link has no target

xpressengine/xe-core#2162
This commit is contained in:
Kijin Sung 2017-10-12 00:22:18 +09:00
parent f2bee9d9ff
commit 7948059c91

View file

@ -225,7 +225,7 @@ jQuery(function($) {
var $this = $(this);
var href = $this.attr('href');
var target = $this.attr('target');
if (target === '_top' || target === '_self' || target === '_parent') {
if (!href || !target || target === '_top' || target === '_self' || target === '_parent') {
return;
}
if (!window.XE.isSameHost(href)) {
@ -242,7 +242,7 @@ jQuery(function($) {
var $this = $(this);
var href = $this.attr('href');
var target = $this.attr('target');
if (target === '_top' || target === '_self' || target === '_parent') {
if (!href || !target || target === '_top' || target === '_self' || target === '_parent') {
return;
}
if (!window.XE.isSameHost(href)) {