Home     |      Learn AJAX     |      Forum     |      Register     |      Submit Resource     |      Submit Article      |      Contact Us

Home AJAX-Tips
 

Multiple Ajax Requests

 

An Ajax based application is only judged useful if the application could provide the interaction expected by its users. As a powerful programming technique in building online applications, users are very demanding on developers who opted to use this as their programming technique.


It is practically a make or break for some developers since an ill-conceived application will only disappoint while the effective application will certainly entertain users. Developers have to invest time and patience in building Ajax since the middle ground or a mediocre application will do no good for users as well as developers. Pushing the application is a must for developers who wanted to get the best out of Ajax.


A very powerful technique in Ajax developers could consider in pushing the application is to enable multiple requests. Normally, an Ajax based application will deal with requests one by one so that data streaming will be a lot easier and data output will be a lot more accurate.


However, developers could use multiple requests so that additional information could be extracted from the application. While waiting for the previous data to be streamed, a new data could be requested and used for additional purposes.


What NOT to Do

Multiple requests in an Ajax based application is relatively easy to implement. But developers have to know what they are NOT supposed to do when using this form of transaction in their online application. What the developers should never do is to avoid using the same object in the same transaction.


The reason for this is simple: a single object as the target of the functions could slow down or even stop the application since the object does not know how to handle these requests at the same time. Still, developers can delay the data requests on objects but it’s safe to completely ignore the object to ensure stability.


Multiple Objects

The key to a successful multiple requests in an Ajax based application is to use multiple objects. By creating more than one object, developers would avoid conflict on functions. By using two or more objects, it would greatly ease the functions in terms of interaction.


Of course, this could take time since another object which will require additional functions and configuration. But if you’re willing to increase interactivity by creating more than one interaction in the browser simultaneously, this is the easiest option.


Different Source of Commands

Aside from ensuring that there are two ore more objects as targets. It is also important to use different source of commands when requesting these objects. For example, you can use XML on the first object while using txt to manipulate the second object. By using two sources, you ensure that there will be no confusion when developers opt to make some modifications on the application.


Enabling multiple requests in Ajax takes time but not very difficult in terms of figuring out the right coding. As long as the two objects are used with different sources of commands, two or more requests at the same time is possible.



Read Next: Hidden iFrame Basics



 

 

Comments



Post Your Comment:

Members Please Login
Your Name:*
e-mail ID:(required for notification)*
Image Verification: 
 
 Subscribe    

Sponsored Links