Javascript is like the cinematic Special Forces guy who parachutes into a jungle and, on his own, kill off an mercenary army of bad-guys. But if he runs out of Cheetos, he puts in an order on his Satphone and a drone later drops him another case of Cheetos, and he is able to continue his senseless, entertaining slaughter. AJax is that Cheetos delivery service. You will find no simpler explanation. You’re welcome.
WordPress makes much use of AJAX in the back-end. Javascript lets you do things in the now, and AJAX makes things happen without you submitting a form. Since you could do hundreds of things when on an admin page, AJAX saves you from pressing “Submit” hundreds of times.
It’s a technology proposed to the Internet, the technology is called XHR. It’s a proposal that also ushered in an age of Asynchronous processes, which required a whole-new way of thinking on how to divvy up your script. Recently, the Javascript people introduced the concept of “Promise”, in which Javascript added functions, libraries and processes that make sure if your Javascript asks another server for something, it will get the result, or know something went wrong. Simple concept, a real headache to build in. BUt this is what it takes to let your script ask its host server for anything.
I do not use AJAX often. I prefer my Javascript to be independent and I do not like bugging the server. If one guy triggers an AJAX, that’s no problem. Nor 100 readers. But 10,000 at the same time keeps a server mighty busy.
One thing I am using AJAX for in the Storyteller plugin is to upload cookies to the server. I could use REST, but since I am adding an ability to upload data to a plugin on a server without a reader signing in, that’s inherently insecure. I use AJAX instead, since it is designed to work wwithin a server and has better security.

Leave a Reply