Friday, December 14, 2007

Ajax Scripts code Technology


Ajax basically puts JavaScript technology and the XMLHttpRequest object between your Web form and the server. When users fill out forms, that data is sent to some JavaScript code and not directly to the server. Instead, the JavaScript code grabs the form data and sends a request to the server. In other words, the JavaScript code sends the request behind the scenes; the user doesn't even realize that the request is being made. Even better, the request is sent asynchronously, which means that your JavaScript code doesn't wait around on the server to respond. So users can continue entering data, scrolling around, and using the application.Then, the server sends data back to your JavaScript code which decides what to do with that data. It can update form fields on the fly, giving that immediate feeling to your application -- users are getting new data without their form being submitted or refreshed. The JavaScript code could even get the data, perform some calculations, and send another request, all without user intervention! I will discuss implementing an Ajax-enabled scrollable table, in which rows are dynamically fetched from the server, as the user scrolls, without the whole page refreshing. This technique is unique and very expedient for implementing pages with a lot of dynamic content in a readable form; for instance, live news feed. As new items are added to the table, the vertical scroll bar will resize and the never-ending scroll will continue. The asynchronous fetching of the data is done with AJAX Scripts. The parsing and dynamic row insertions are done in JavaScript, the requests are done with the XMLHttpRequest object, and the table appearance is controlled by the CSS.This JavaScript object can send requests asynchronously and receive responses from the server, without page refresh. Many web sites currently participating in the Web 2.0 design methodology often use a lot of Ajax to offer rich client interfaces, the XMLHttpRequest is extensively used on such sites and content of the page changes dynamically based on the user action. The dynamic scroll is also possible in part because of the new CSS2 standards, which are supported by the main browsers as well. In the sample code, I will show how to implement scrollable table that occupies some part of the screen, but if CSS were not supported and only Ajax were, the dynamic table would scroll the whole page, and not part of it. Dynamic table on the Google reader site. Note that there are 100 items in the table on the first screenshot and, as the vertical scroll bar is moved down more rows appear, the number changes to 140, and the scroll bar also resizes. All other elements remain in the same positions on the page. Adding in some JavaScript
This is write Robert Williams will be dealing with Website Development as they were defined for the purpose of website promotion / web Page optimization and SEO Service India.

No comments: