background preloader

Ajax

Facebook Twitter

Tour

Drop. S o l u t o i r e . c o m - ajax resources. Ajaxian. A JavaScript Presentation Framework. A Simpler Ajax Path. By Matthew Eernisse 05/19/2005 I began working with web applications back in the bad old days, when making an application behave like a desktop app meant wrestling with byzantine table-based layouts nested five and six levels deep, and horrid, hackish frame sets within frame sets within frame sets. Those were the days. Things have steadily improved for web developers with the advent of standards-compliant browsers, CSS, DHTML, and the DOM. Pervasive broadband access has made web apps feel a lot snappier. While not exactly new, the XMLHttpRequest object is receiving more attention lately as the linchpin in a new approach to web app development, most recently dubbed Ajax (asynchronous JavaScript and XML), which powers the cool features found on sites like Flickr, Amazon's A9.com, and the new poster children for whizzy web-based interactivity, Google Maps and Google Suggest.

Introducing the Object Note that despite its name, you can use the XMLHttpRequest object with more than just XML. Take Command with AJAX [JavaScript & DHTML Tutorials] Do you want to build more dynamic, responsive, desktop-like web applications like Gmail and Google Maps? Then this article is for you! It guides you through the Ajax basics and through the process of building a simple Ajax application. That application is named WebConsole, a browser interface for executing system commands for which you’d usually need shell access. There are also short examples of using the Ajax functionality of two popular JavaScript libraries – jQuery and YUI. In this article, first published in 2005 and recently updated, I’ll explain the creation of one simple, reusable JavaScript function for making HTTP requests. Although there are some YUI and jQuery examples, the article is not a tutorial on a specific Ajax library.

A Simple HTTP Request Example Let’s first revise the flow of making an HTTP request in JavaScript, and handling the response. There are three basic steps: Create an XMLHttpRequest object. <button id="mybutton">Make a request</button> The Problem if (! <? AJAX:Getting Started - MDC. This article guides you through the AJAX basics and gives you two simple hands-on examples to get you started.

What's AJAX? AJAX stands for Asynchronous JavaScript and XML. In a nutshell, it is the use of the XMLHttpRequest object to communicate with server-side scripts. It can send as well as receive information in a variety of formats, including JSON, XML, HTML, and even text files. The two features in question are that you can: Make requests to the server without reloading the page Receive and work with data from the server Step 1 – How to make an HTTP request In order to make an HTTP request to the server using JavaScript, you need an instance of a class that provides this functionality.

As a result, in order to create a cross-browser instance (object) of the required class, you can do the following: var httpRequest;if (window.XMLHttpRequest) { httpRequest = new XMLHttpRequest();} else if (window.ActiveXObject) { httpRequest = new ActiveXObject("Microsoft.XMLHTTP");} (Source) <?