mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-10 04:24:14 +09:00
Fix #1028 JS error when attribute does not exist
This commit is contained in:
parent
4ca57ae95a
commit
e506975439
1 changed files with 4 additions and 4 deletions
|
|
@ -252,8 +252,8 @@ jQuery(function($) {
|
||||||
/* Tabnapping protection, step 1 */
|
/* Tabnapping protection, step 1 */
|
||||||
$('a[target]').each(function() {
|
$('a[target]').each(function() {
|
||||||
var $this = $(this);
|
var $this = $(this);
|
||||||
var href = $this.attr('href').trim();
|
var href = String($this.attr('href')).trim();
|
||||||
var target = $this.attr('target').trim();
|
var target = String($this.attr('target')).trim();
|
||||||
if (!href || !target || target === '_top' || target === '_self' || target === '_parent') {
|
if (!href || !target || target === '_top' || target === '_self' || target === '_parent') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -269,8 +269,8 @@ jQuery(function($) {
|
||||||
/* Tabnapping protection, step 2 */
|
/* Tabnapping protection, step 2 */
|
||||||
$('body').on('click', 'a[target]', function(event) {
|
$('body').on('click', 'a[target]', function(event) {
|
||||||
var $this = $(this);
|
var $this = $(this);
|
||||||
var href = $this.attr('href').trim();
|
var href = String($this.attr('href')).trim();
|
||||||
var target = $this.attr('target').trim();
|
var target = String($this.attr('target')).trim();
|
||||||
if (!href || !target || target === '_top' || target === '_self' || target === '_parent') {
|
if (!href || !target || target === '_top' || target === '_self' || target === '_parent') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue