mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 18:51:41 +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 */
|
||||
$('a[target]').each(function() {
|
||||
var $this = $(this);
|
||||
var href = $this.attr('href').trim();
|
||||
var target = $this.attr('target').trim();
|
||||
var href = String($this.attr('href')).trim();
|
||||
var target = String($this.attr('target')).trim();
|
||||
if (!href || !target || target === '_top' || target === '_self' || target === '_parent') {
|
||||
return;
|
||||
}
|
||||
|
|
@ -269,8 +269,8 @@ jQuery(function($) {
|
|||
/* Tabnapping protection, step 2 */
|
||||
$('body').on('click', 'a[target]', function(event) {
|
||||
var $this = $(this);
|
||||
var href = $this.attr('href').trim();
|
||||
var target = $this.attr('target').trim();
|
||||
var href = String($this.attr('href')).trim();
|
||||
var target = String($this.attr('target')).trim();
|
||||
if (!href || !target || target === '_top' || target === '_self' || target === '_parent') {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue