AJAX normally stands for three things:
- A is for asynchronous, meaning that your browser doesn't (always) have to wait for the server it's talking to to get back to it.
- J is for Javascript (or JScript, or more technically ECMAScript), which is one way for your browser to run custom code on its own while it's not waiting for the server.
- X is for XML, which is XML.
In theory, the browser could use any language for its scripts. ECMAscript is the choice in practice because it's close to languages like Java and C# that lots of people know [... ehhh, depends on what you mean by "close". If you mean syntactically, sure, but the computing model underneath is notoriously idiosyncratic --D.H. Dec 2018], and more importantly because the major browsers support it.
XML is even more a matter of choice. If you're building a web page, you can define your own format if you really really want to. Or you could use JSON, or anything else you can find a library for. Not to say that there aren't arguments for using XML, just that "it's the only game in town" isn't one of them.
But you can't do any of this fun stuff without a way for the browser to take on some of the processing, and particular to be able to do that processing without waiting for a server response. The A for "asynchronous" is the essential "what" here. The J and the X are the vital but to at least some extent interchangeable "how".
No comments:
Post a Comment