Jump to content
  • Advertisement
Sign in to follow this  
Zaku

very confused about ajax

This topic is 4145 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
Advertisement
Take a look on w3schools specifically the 'Learn XML' and 'Learn AJAX' sections, thats where I went when I wanted those questions answered :).

Share this post


Link to post
Share on other sites
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?

Ajax is a subset of javascript. It's one programming technique that you can do in javascript. It's not "different" :)

Quote:

what does ajax have that javascript alone doesnt have?

Nothing (see previous paragraph)

Quote:

what exactly IS xml?


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.

By the way, Wikipedia is a great place to go for these kinds of questions.

Share this post


Link to post
Share on other sites
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!"

Share this post


Link to post
Share on other sites
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.

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.

AJAX is usually used to denote encapsulated functionality of XmlHTTPRequest object with additional asynchronous handling mechanisms, utility functions and various support tools.

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.

Share this post


Link to post
Share on other sites
ok, so ajax is to load new pages without having to refresh the screen. how crucial is this to javascript game making?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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?


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
) then AJAX is what you want.

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.

It does fix a lot of the issues with the web, but it is just a patch [grin]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!