Funding for 'IT Lab' Project, Phase 1: Progress of sticker sales. Purchase a sticker to help us reach our target.Updated: 2010-02-28 11:53
AJAX without the hassle
by Kusal ArthanayakaAsynchronous JavaScript and XML (AJAX) is not hard as it may seems. As the name implies it is all about JavaScript. Even though the name talks about XML,
Most famous example is checking username without a page load. Usually found on register pages. If you look at both new Gmail and yahoo mails it uses
You don’t need to write raw JavaScript to use
If you like to learn about core JavaScript underlining

Copy this code and create an html page. Also create a text file. Name it as result (using notepad). inside the text file write anything you like.
In this example we have created a button with the function send_request() called on click. Also just above the button we have placed a span tag with the id “result” which will hold the result from the
If you go thorough that fuction you’ll first see that we are using GET method to send the request using dojo.xhrGet
In the url: you give the path to the text file we created earlier.
Load: will invoke the function Callback
Now we can use the variable data to assign the output to the span tag using DHTML
document.getElementById('result').innerHTML = data;
Error function will only be invoked if something goes worng.
Post new comment