diff --git a/src/js/_enqueues/lib/ajax-response.js b/src/js/_enqueues/lib/ajax-response.js
index f1b0dcd361..3fd6ff0314 100644
--- a/src/js/_enqueues/lib/ajax-response.js
+++ b/src/js/_enqueues/lib/ajax-response.js
@@ -53,19 +53,27 @@ window.wpAjax = jQuery.extend( {
parsed.responses.push( response );
} );
if ( err.length ) {
- re.html( '
' + err + '
' );
+ re.html( '' + err + '
' );
wp.a11y.speak( err );
} else if ( noticeMessage.length ) {
- re.html( '');
+ re.html( '');
jQuery(document).trigger( 'wp-updates-notice-added' );
wp.a11y.speak( noticeMessage );
}
return parsed;
}
- if ( isNaN(x) ) { return !re.html(''); }
- x = parseInt(x,10);
- if ( -1 === x ) { return !re.html(''); }
- else if ( 0 === x ) { return !re.html(''); }
+ if ( isNaN( x ) ) {
+ wp.a11y.speak( x );
+ return ! re.html( '' );
+ }
+ x = parseInt( x, 10 );
+ if ( -1 === x ) {
+ wp.a11y.speak( wpAjax.noPerm );
+ return ! re.html( '' );
+ } else if ( 0 === x ) {
+ wp.a11y.speak( wpAjax.broken );
+ return ! re.html( '' );
+ }
return true;
},
invalidateForm: function ( selector ) {