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

Home AJAX-Tips
 

Return Options for Ajax Applications

 

Properly building an Ajax based application is all about the right interplay of JavaScript and XML. The use of JavaScript as the main programming language is necessary in properly building the online application. However, the “X” part which stands for XML could be changed.


There is no denying that XML has become the standard for Ajax for a good reason – it has the ability to work with the client side flawlessly has already been proven. This feature makes it a lot easier for building asynchronous application.


However, there are situations wherein XML is not the necessary return for building an Ajax based applications. A good example is when there is a necessity to use JavaScript through SOAP (Simple Object Access Protocol). Although XML could still work under these circumstances, it might be overwhelmed by its complexity.


Here are the return options you can consider to effectively build an Ajax based application:


HTML – There used to be a time where Ajax is an efficient combination of JavaScript, HTML and XML. HTML became the platform for different functions of JavaScript as the data will be transmitted as XML. Today, HTML could be considered as another option in doing the functions of XML. Using HTML is very feasible when you have a powerful server that could support the data you are trying to implement in the client side. Basically, using HTML is only feasible when you want to inject some classic functionality of server to client side communication.


However, you should think twice in using HTML if you are thinking of a continuously evolving application. Synching HTML with the client side will take time and changes required for a small update will drain too many resources.


Text – The lightest return that you can possibly have in building an Ajax based application. The return in terms of plain text will be a little bit lighter compared to HTML but a lot simpler. The challenge in building an Ajax based application with plain text return is the improvement of graphics and interface in the application. Basically you are just left with simple HTML commands through plain text.


JSON – Short for JavaScript Object Notation, this is increasingly becoming the preference of most developers for Ajax based application. The reason is pretty simple: JSON was specifically built for JavaScript so JSON can easily interact with JavaScript in most of its functions.


The only drawback (if you can call it as such) is when you are not at ease in using JavaScript eval ().


Mash-Ups

XML, HTML, JSON and Text as return are not exclusive. Thanks to the power of Mash-ups, you can build an application using these altogether. Although this might increase the complexity of the application, an extra work on each return option is worth it if you want to build an application.


Just remember to ensure security in using these as mash-ups could open up a lot of security holes which will later be exploited by the application. When these data returns are exploited, you could end up with a big security problem.



Read Next: Coding for Different Platforms



 

 

Comments



Post Your Comment:

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

Sponsored Links