Skip to content

Commit

Permalink
Coding Standards: Use strict comparison in `js/_enqueues/lib/ajax-res…
Browse files Browse the repository at this point in the history
…ponse.js`.

Props ankitmaru.
Fixes #50320.

git-svn-id: https://develop.svn.wordpress.org/trunk@48040 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
SergeyBiryukov committed Jun 14, 2020
1 parent d7b5385 commit 9c0fd94
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/js/_enqueues/lib/ajax-response.js
Expand Up @@ -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() {
Expand Down Expand Up @@ -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;
},
Expand Down

0 comments on commit 9c0fd94

Please sign in to comment.