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

Home AJAX-Tips
 

Better Data Transfer with GET Requests

 

Data transfer in an Ajax based application is a very important component. As application is basically a form of data processing, proper data transfer is a must in an online application. JavaScript already has components that could effectively implement data transfer in the application.


The XHR or XMLHttpRequest have been used extensively to ensure data transfer should be enabled in the client side. Its foremost component – the GET command is extensively used to tag information not only from its server to the client but also from other online resources.


But usage of GET in XHR for data transfer is usually shunned by developers. In a perfect setting, GET in XHR provides the ultimate data transfer in terms of client side functionality. But these components are usually laden with problem such as browser incompatibility as well as insecurity.


These two components are the biggest problems a developer would have in developing an online application. These problems could single handedly destroy the application if they are not properly considered by its developers. For that reason, GET in XHR has to be added with simple components to ensure the application will work as planned.


Solutions for Get Requests

Using the Server Side Proxy – The biggest challenge for GET in XHR is on how the components will work well in different browser. Instead of directly connecting to the data source, developers could create a server side proxy dedicated for each browser. The proxy will be directly linked to a specific browser through an iFrame which will become the launching pad for the client side.


But this technique often presents a problem especially in using iFrame. Although the application might handle the problem effectively, this solution is not recommended if the application has to be as lightweight as possible.


Developing Script Transport – A good option for developers who wanted to keep their application as lightweight as possible is to use script transport. In gist, this technique will convert data into scripts which could be effectively conveyed in the client side. One good example is to use the function window.postMessage. This function will enable developers to effectively launch data from the server to the client side.


But the catch for this function is that it can only be effective on the latest browsers. The function that was just indicated is a function that could only be used with the latest version of HTML (version 5).


Using Proxy Server – Another solution that could be used by developers in establishing XHR without having to deal with browser incompatibility is to have a proxy server for browser. The difference of this technique compared to Server Side Proxy is that the Proxy Server will launch data on request while Server Side Proxy will launch every component on the client side when the website is loaded. By launching data on request, developers should have a stable application without having to deal with browser incompatibility.


However, the problem in this setting is that the additional proxy server could create another problem. Aside from the regular server and client side, the proxy server have to be consistently monitored.



Read Next: Using TraceVis for Better Ajax Application



 

 

Comments



Post Your Comment:

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

Sponsored Links