very confused about ajax
i know that ajax stands for asynchronous javascript and XML. im currently learning javascript. my question is: considering game making, how is ajax different from just using javascript? what does ajax have that javascript alone doesnt have? what exactly IS xml?
Take a look on w3schools specifically the 'Learn XML' and 'Learn AJAX' sections, thats where I went when I wanted those questions answered :).
Quote:Original post by Zaku
i know that ajax stands for asynchronous javascript and XML. im currently learning javascript. my question is: considering game making, how is ajax different from just using javascript?<!--QUOTE--></td></tr></table></BLOCKQUOTE><!--/QUOTE--><!--ENDQUOTE--><br>Ajax is a <i>subset</i> of javascript. It's one programming technique that you can do in javascript. It's not "different" :)<br><br><!--QUOTE--><BLOCKQUOTE><span class="smallfont">Quote:</span><table border=0 cellpadding=4 cellspacing=0 width="95%"><tr><td class=quote><!--/QUOTE--><!--STARTQUOTE--><br> what does ajax have that javascript alone doesnt have?<!--QUOTE--></td></tr></table></BLOCKQUOTE><!--/QUOTE--><!--ENDQUOTE--><br>Nothing (see previous paragraph)<br><br><!--QUOTE--><BLOCKQUOTE><span class="smallfont">Quote:</span><table border=0 cellpadding=4 cellspacing=0 width="95%"><tr><td class=quote><!--/QUOTE--><!--STARTQUOTE--><br> what exactly IS xml?<!--QUOTE--></td></tr></table></BLOCKQUOTE><!--/QUOTE--><!--ENDQUOTE--><br><br>A text file format that uses a lot of "<" and ">" symbols. It's a popular way to wrap up data in a way that any system will be able to understand it.<br><br>By the way, Wikipedia is a great place to go for these kinds of questions.
AJAX is little more than the realization that "Gosh, most browsers' implementation of javascript supports a function for making asynchronous web requests. Hey, we could use this to load pages more smoothly. Instead of fetching the entire page when the user clicks on a link, we can just fire off an asynchronous request, and when we get the result, update the existing page. Woo, we're so clever!"
AJAX is a marketing hype word.
It comes down to a single simple javascript object: XmlHttpRequest.
What is unique about this object, is that it's capable of sending requests to servers outside of usual HTTP request/response mechanism.
This in turn allows your static javascript enabled webpages to request and receive data on demand, rather than passively as normal HTTP does.<br><br>When combined with DHTML and DOM, the simple request object allows you to reconstruct any single part of webpage without reloading it. This is a very basic, but essential building block of interactive applications.<br><br>AJAX is usually used to denote encapsulated functionality of XmlHTTPRequest object with additional asynchronous handling mechanisms, utility functions and various support tools.<br><br>XML is essentially same as HTML, but it doesn't define tags. So rather than having h6, blink and body tags, you define and use your own. This makes for a self-descriptive format, human readable and extensible.
It comes down to a single simple javascript object: XmlHttpRequest.
What is unique about this object, is that it's capable of sending requests to servers outside of usual HTTP request/response mechanism.
This in turn allows your static javascript enabled webpages to request and receive data on demand, rather than passively as normal HTTP does.<br><br>When combined with DHTML and DOM, the simple request object allows you to reconstruct any single part of webpage without reloading it. This is a very basic, but essential building block of interactive applications.<br><br>AJAX is usually used to denote encapsulated functionality of XmlHTTPRequest object with additional asynchronous handling mechanisms, utility functions and various support tools.<br><br>XML is essentially same as HTML, but it doesn't define tags. So rather than having h6, blink and body tags, you define and use your own. This makes for a self-descriptive format, human readable and extensible.
ok, so ajax is to load new pages without having to refresh the screen. how crucial is this to javascript game making?
Depends on the kind of game you're making. If you want to be able to load new stuff from the server without making the user refresh the whole page, you use Ajax.
You don't really use javascript or AJAX for games unless your making a web based game like neopets (*barfs)
Quote:Original post by Zaku
i know that ajax stands for asynchronous javascript and XML. im currently learning javascript. my question is: considering game making, how is ajax different from just using javascript? what does ajax have that javascript alone doesnt have? what exactly IS xml?<!--QUOTE--></td></tr></table></BLOCKQUOTE><!--/QUOTE--><!--ENDQUOTE--><br><br>If your javascript game is going to run all on one page or load at once, then you don't need AJAX at all. If you want to load a page with javascript and then allow the user to click on something (button/link/anything that has javascript) and just update a part of the page (could be a var or something within a tag like <div>) then AJAX is what you want.<br><br>At work we have been using it fairly extensively since we have multiple tables that each have navigation. We'd like to only update the tables that need to be updated rather than the top title screen /w menus and all the tables. Then manage where in each table the user is becomes more complicated than without js/ajax.<br><br>It does fix a lot of the issues with the web, but it is just a patch [grin]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement