very confused about ajax

Started by
7 comments, last by nprz 16 years, 9 months ago
i know that ajax stands for asynchronous &#106avascript and XML. im currently learning &#106avascript. my question is: considering game making, how is ajax different from just using &#106avascript? what does ajax have that &#106avascript alone doesnt have? what exactly IS xml?
Advertisement
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 &#106avascript and XML. im currently learning &#106avascript. my question is: considering game making, how is ajax different from just using &#106avascript?<!--QUOTE--></td></tr></table></BLOCKQUOTE><!--/QUOTE--><!--ENDQUOTE--><br>Ajax is a <i>subset</i> of &#106avascript. It's &#111;ne programming technique that you can do in &#106avascript. 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 &#106avascript 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 "&lt;" and "&gt;" 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 &#106avascript 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 &#106avascript 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 &#106avascript enabled webpages to request and receive data &#111;n 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 &#106avascript 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 &#106avascript 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 &#106avascript and XML. im currently learning &#106avascript. my question is: considering game making, how is ajax different from just using &#106avascript? what does ajax have that &#106avascript alone doesnt have? what exactly IS xml?<!--QUOTE--></td></tr></table></BLOCKQUOTE><!--/QUOTE--><!--ENDQUOTE--><br><br>If your &#106avascript game is going to run all &#111;n &#111;ne page or load at &#111;nce, then you don't need AJAX at all. If you want to load a page with &#106avascript and then allow the user to click &#111;n something (button/link/anything that has &#106avascript) 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 &#111;nly 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