AJAX-Tips
Ajax has the ability to refresh specific parts of the webpage. In an HTML based website, we have to be content with reloading the whole webpage every time we make a call for information. Web Remoting is the term applied in Ajax and other type of websites wherein a specific part of the website is only refreshed instead of the whole webpage. There are three popular types of web remoting that are usually applied to Ajax. The most popular is the XMLHttpRequest call. It’s a very simple call from the browser to the server and a command can easily be attached to this web remoting tag. Virtually every developer uses this in every Ajax based website when they want to isolate a specific part of the website. Another type of web remoting is the IFrame call. Even before Ajax was conceptualized, IFrame call has already been used in different types of websites such as Java or Flash based websites. It can also be activated in Ajax however it’s rarely used nowadays as the standard code for Ajax. But that doesn’t mean Ajax cannot use IFrame. There are certain situations in Ajax wherein IFrame performs even better compared to XMLHttpRequest. One great example is when your website is not using multi-threading. Instead of using complex XMLHttpRequest, IFrame is quiet simple and easier to monitor. However, since most of the websites are multi-threaded, IFrame is rarely used except to simple websites. The last web remoting type is HTTP Streaming. Developers also call this action as “server push”. Like IFrame this is rarely used however it can be used in specific cases. HTTP Streaming is a powerful command for the server but with little to no action from the browser. With one command, different actions and information are streamed in the website. This is typically used in an Ajax based web monitoring tool. Although it could be combined with XMLHttpRequest, it could be too heavy for the server as it takes constant command and random requests from the server. Like IFrame, HTTP Streaming is easier to monitor. There could be independent software or another web based software that could monitor the actions of the website. These are the three functions that could be activated in an Ajax based website. For security purposes, it’s always better to use XMLHttpRequest for a regular website. Other web remoting commands should be used in the very specific websites and functions. Remember that both commands especially the HTTP Streaming is very intensive to the server so caution has to be used. XMLHttpRequest is frequently used because it still takes another command, usually from the browser so that it could provide specific action. With the XMLHttpRequest command, instead of the whole webpage being reloaded; only the specific part of the page is changed. IFrame and HTTP Streaming on the other hand should also be mastered by any developer properly. Without any knowledge of IFrame and HTTP Streaming, developer might not be able to branch out in designing Ajax based software and websites.