diff options
author | Sergey Biryukov <sergeybiryukov@git.wordpress.org> | 2020-06-14 11:26:22 +0000 |
---|---|---|
committer | Sergey Biryukov <sergeybiryukov@git.wordpress.org> | 2020-06-14 11:26:22 +0000 |
commit | 9c0fd945582622506312aafbd8079a5b933218a5 (patch) | |
tree | debc77ef8e4c8aed2c0ac8675d02d5b738a0e270 /src/js/_enqueues/lib/ajax-response.js | |
parent | d7b5385f049236794ca59f6ced694243e0b4538d (diff) | |
download | wordpress-9c0fd945582622506312aafbd8079a5b933218a5.tar.gz wordpress-9c0fd945582622506312aafbd8079a5b933218a5.zip |
Coding Standards: Use strict comparison in `js/_enqueues/lib/ajax-response.js`.
Props ankitmaru.
Fixes #50320.
git-svn-id: https://develop.svn.wordpress.org/trunk@48040 602fd350-edb4-49c9-b593-d223f7449a82
Diffstat (limited to 'src/js/_enqueues/lib/ajax-response.js')
-rw-r--r-- | src/js/_enqueues/lib/ajax-response.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/js/_enqueues/lib/ajax-response.js b/src/js/_enqueues/lib/ajax-response.js index f2eedf3732..a6fdb3ba8d 100644 --- a/src/js/_enqueues/lib/ajax-response.js +++ b/src/js/_enqueues/lib/ajax-response.js @@ -20,7 +20,7 @@ window.wpAjax = jQuery.extend( { parseAjaxResponse: function( x, r, e ) { // 1 = good, 0 = strange (bad data?), -1 = you lack permission. var parsed = {}, re = jQuery('#' + r).empty(), err = ''; - if ( x && typeof x == 'object' && x.getElementsByTagName('wp_ajax') ) { + if ( x && typeof x === 'object' && x.getElementsByTagName('wp_ajax') ) { parsed.responses = []; parsed.errors = false; jQuery('response', x).each( function() { @@ -51,7 +51,7 @@ window.wpAjax = jQuery.extend( { } if ( isNaN(x) ) { return !re.html('<div class="error"><p>' + x + '</p></div>'); } x = parseInt(x,10); - if ( -1 == x ) { return !re.html('<div class="error"><p>' + wpAjax.noPerm + '</p></div>'); } + if ( -1 === x ) { return !re.html('<div class="error"><p>' + wpAjax.noPerm + '</p></div>'); } else if ( 0 === x ) { return !re.html('<div class="error"><p>' + wpAjax.broken + '</p></div>'); } return true; }, |