Sign in to follow this  

[web] When should I use AJAX?

This topic is 3863 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

Hi, What do people usually consider before determining whether to use AJAX or GET/POST? Additionally, is it safe to assume that most people turn on their javascript on their browsers? Thanks, - dadads -

Share this post


Link to post
Share on other sites
It should be safe to assume javascript is turned on, unless you have some special requirements.

If you use AJAX, the you still use GET/POST, most commonly GET. GET/POST are standard HTML methods, AJAX just uses javascript to call these methods in a dynamic way. (Opposed to forms and links/hrefs which call GET/POST in a more 'static' way.)

Share this post


Link to post
Share on other sites
Another such use for AJAX could be for some sort of small tabbed-browsing, like a little set of tabs on the side of the page or what not, that you would want to be changed on user request without reloading the whole page.
Usually simple stuff like that, with emphasis on "user request".

Share this post


Link to post
Share on other sites
The thing you should ask yourself is if it will help my users in one or more of the following
A) Speed (Complete page reloads compared to partial page reloads)
B) Ease of use

For a site I where the programmer on I made the decision to use AJAX in the game menu based on that it increased the speed of the site and removed ugly page reloads in IE where the background was seen. Without AJAX the site is almost unusable in IE. Firefox however handles page reloads in a much nicer way so the difference isn't that large.

If you want more help in deciding then you will have to tell us a bit more about the site your planing on making/recreating.

Share this post


Link to post
Share on other sites
Quote:
Original post by dadads
What do people usually consider before determining whether to use AJAX or GET/POST?

It's not necessarily an either/or situation. You want to support GET/POST as the baseline functionality, then layer JavaScript functionality on top of that (first simple things like preventing double-clicking a submit button), then layer asynchronous design on top of that.

Considerations include availability of JavaScript, of course, but also factors like bandwidth, the amount of traffic being schlepped back and forth asynchronously, server capacity and specifics of the application. I'm bidding on a contract to develop an internal web-based app for a magazine publisher. For the specifics of the application, the user base and the nature of the data, asynchronous methods make sense. However, asynchronous methods require that I pay special attention to data security, so that sensitive data isn't left around when the app is accessed from a public terminal.

Share this post


Link to post
Share on other sites

This topic is 3863 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this