Tag: ajax
-

Missing Response.statusText under HTTPS (e.g. Unauthorized is empty string)
We have a generic error handling, that shows an error to the user when a request fails. The error contains information on when it happened, and the status text of the response. (response.statusText). Recently we discovered that the statusText was missing in the screenshot of one our the reported bugs. It turned out that response.statusText…
-
JS variable loaded using wp_localize_script is no longer available
TL;DR: Call the wp_localize_script after registering/enqueuing the script you are localizing. Recently (WP 4.1.4 / WP 4.2) my ajax scripts stopped working. I’ve noticed that it was caused by the fact that the variable for the ajax_url was undefined so for some reason it ws no longer loaded to the page. The reason turned out…