From 9c0fd945582622506312aafbd8079a5b933218a5 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sun, 14 Jun 2020 11:26:22 +0000 Subject: [PATCH] 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 --- src/js/_enqueues/lib/ajax-response.js | 4 ++-- 1 file 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('

' + x + '

'); } x = parseInt(x,10); - if ( -1 == x ) { return !re.html('

' + wpAjax.noPerm + '

'); } + if ( -1 === x ) { return !re.html('

' + wpAjax.noPerm + '

'); } else if ( 0 === x ) { return !re.html('

' + wpAjax.broken + '

'); } return true; },