Sunday, November 9, 2008

Interactive web page experience

The advantage of browser based client is the ease of deployment. However user is always held back by the synchronous nature of the request-response underpinnings of the Internet – the latency of complete page refresh.

Microsoft has introduced the concept of remote scripting (MSRS) to overcome this limitation. It allow developer to interact with the server asynchronously. For example, user can select the drop down list and causing a script to run at the server to download the value for the drop down list, without a complete page refresh. MSRS works with Microsoft technology only and requires Java.

Brent Ashley developed JSRS (JavaScript Remote Scripting) using client-side JavaScript library and DHTML to make asynchronous call to server. Other people uses IFRAME to reload only part of the page or make hidden call to the server.

AJAX is another solution. It is not new. It is the “newest” technology related to XMLHttpRequest object (XHR) which has been around since IE5 (1999) as an ActiveX control. XHR since then has also implemented in other browser such as Mozilla and Safari. It is even covered in a W3C standard: DOM Level 3 Load and Save Specification. AJAX is a client-side approach and can interact with J2EE, .Net, PHP, Ruby and CGI scripts. In other words, it is server-agnostic.

Load and Save is the culmination of an effort that began in 1997 as a way to solve the incompatibilities in the browsers. DOM Level 1 was finished in 1998 giving HTML 4.0 and XML 1.0. DOM Level 2 completed in 200 giving CSS. Load and Save gives Web developer a common, platform-independent API to access and modify the DOM.

DOM is based on a concept from OMG. DOM defines the data and structure on a page. DOM give you a standard way to interact with your documents. By modifying the structure of a web page, you dynamically change the display, resulted in giving a rich client interactive environment to the user. For example, when the user client on the search button, your page makes an aynchronous call via XHR to do the search. After the server returns the search result, you use DOM call to modify the web page to display the search result (for example, in the form of a table). The broswer adjust the display and thus give a interactive sensation to the user.

No comments: