AJAX - Request a Server
To send off a request to the server, we use the open() method and the send() method.
The open() method takes three arguments. The first argument defines which method to use when sending the request (GET or POST). The second argument specifies the URL of the server-side script. The third argument specifies that the request should be handled asynchronously. The send() method sends the request off to the server. If we assume that the HTML and ASP file are in the same directory, the code would be:
xmlHttp.open(”GET”,”time.asp”,true);
xmlHttp.send(null);
Now we must decide when the AJAX function should be executed. We will let the function run “behind the scenes” when the user types something in the username text field:
function ajaxFunction()
{
var xmlHttp;
try
{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
// Internet Explorer
try
{
xmlHttp=new ActiveXObject(”Msxml2.XMLHTTP”);
}
catch (e)
{
try
{
xmlHttp=new ActiveXObject(”Microsoft.XMLHTTP”);
}
catch (e)
{
alert(”Your browser does not support AJAX!”);
return false;
}
}
}
xmlHttp.onreadystatechange=function()
{
if(xmlHttp.readyState==4)
{
document.myForm.time.value=xmlHttp.responseText;
}
}
xmlHttp.open(”GET”,”time.asp”,true);
xmlHttp.send(null);
}
AJAX - The XMLHttpRequest Object
Before sending data to the server, we have to explain three important properties of the XMLHttpRequest object.
The onreadystatechange Property
After a request to the server, we need a function that can receive the data that is returned by the server.
The onreadystatechange property stores your function that will process the response from a server. This is not a method, the function is stored in the property to be called automatically. The following code sets the onreadystatechange property and stores an empty function inside it:
xmlHttp.onreadystatechange=function()
{
// We are going to write some code here
}
The readyState property holds the status of the server’s response. Each time the readyState changes, the onreadystatechange function will be executed.
Here are the possible values for the readyState property:
o-The request is not initialized
1-The request has been set up
2-The request has been sent
3-The request is in process
4-The request is complete
xmlHttp.onreadystatechange=function()
{
if(xmlHttp.readyState==4)
{
// Get the data from the server’s response
}
}
The data sent back from the server can be retrieved with the responseText property.
In our code, we will set the value of our “time” input field equal to responseText:
xmlHttp.onreadystatechange=function()
{
if(xmlHttp.readyState==4)
{
document.myForm.time.value=xmlHttp.responseText;
}
}
MiniAjax - Free Downloadable Ajax Scripts
Have you ever wanted to do something with ajax but didnt want to code it yourself or pay to have it coded for you? Check out MiniAjax.com Here is a list of a few things they have for download:
- Prototype Windows
- Ajax Star Rating Bar
- Site Heatmapping Script
- GrayBox Popup Script
- Bubble Tool Tips
- Ajax Tabs Script
- Ajax Poller Script
- Ajax Pie and Donut Chart Script
- Ajax Form Validation Script
And much, much more. Check it out now.
Wufoo
Wufoo is a web-based tool to help you build and host amazing online forms. In only a few short minutes, you can create a mailing list, a marketing survey or even a complete customer management system. In other words, Wufoo is an Internet application that helps anybody build amazing online forms. When you design a form with Wufoo, it automatically builds the database, backend and scripts needed to make collecting and understanding your data easy, fast and fun. Because we host everything, all you need is a browser, an Internet connection and a few minutes to build a form and start using it right away. As it is beta stage right now, its tough to see how it would compete with JotForm.
yWriter 4
Fiction writers can always benefit from useful tools that are free. Keeping track of story lines and characters can sometimes become a hectic task, but it is not an impossible one. yWriter 4 can definitely handle its own among other free applications and some paid ones as well. If you are serious about writing and don’t want a flashy user interface, then this application is what you need. It will conveniently help you to keep track of plot lines, characters, and drafts. All of your information will be organized in a simple form.
To get started, just simply download and install the application. You’ll be able to move forward in your writing via project levels. Import your existing novels in accordance with the yWriter’s format. If your work is in PDF or .doc format, then yWriter is not capable of importing it. Despite this little set back, it is still an excellent program overall. Your chapters will be displayed in spreadsheet form for viewing. After importing all of your chapters and scenes into yWriter, you’ll then be able to add notes, descriptions, or other details.
Looking at the yWriter format will remind you of the classic Windows style. It is not flashy, but it still gets the job done. In order to successfully complete your novel, most writers do not need a fancy interface filled with bells and whistles. The best part of using this program is that it is simple to use. Once you start working with it, you’ll notice how fast you completed your novel.
Microsoft Office Live Workspace
Although Microsoft can produce some well functioning products, there are times that they miss the mark completely. As technology moves onward, online storage space has become a necessity. Instead of just relying on local storage, users can access important information and documents virtually anywhere. The only requirements are a high speed internet connection, an online storage account, and a device to access it. Considering the popularity of online storage, Microsoft has tried to enter this realm as well.
Office Live Workspace is more of a personalized version of online storage. It allows you to share important documents, share calendars, and create discussions. Although working with Office Live Workspace was a pleasure at times, there were also too many bugs to make it completely enjoyable. In its beta stage, I wouldn’t feel secure enough to place all of my vital documents into this online storage.
One of the largest disappointments is the lack of editing once a document is uploaded. If you need to add something or make other changes when accessing from another computer, you must do so before uploading. I’ve worked with other free online storage systems that give me this capability without any issues. I would much prefer working with an online storage system that offers flexibility on my level.
Some of the best benefits of working with Office Live Workspace is the clean interface free from unwanted advertisements. Finding controls are not a problem because they are conveniently placed in easy to reach locations. Hopefully in the future, this program will have a more stable platform and added features for complete customization.
AJAX RESOURDES
So - how do you find out more about Ajax and how it interacts with the system?Before I found this weblog I though Ajax was something we used to clean the bathroom. (haha) Now I understand some of the potential...
Practical Javascript, DOM Scripting, and Ajax ProjectsPractical Javascript, DOM Scripting, and Ajax Projects picks up where Beginning JavaScript with DOM Scripting and Ajax left off. Frank...
Beginning JavaScript with DOM Scripting and AjaxBeginning JavaScript with DOM Scripting and Ajax will take you from knowing absolutely nothing about JavaScript to being able to manipulate...
Review: Beginning Ajax with PHPBeginning Ajax with PHP (by Lee Babin) is a good introduction to learning JavaScript client-server techniques on the PHP platform. Some...
Huge list of Ajax tutorialsJust found this list of 126 Ajax Tutorials over the weekend — here’s a sampling: Ajax Workshop 3: Shopping Cart using...
JAVASCRIPT
Hiding a divI think there are a lot of people like you work a lot in code instead of design mode, for those in my situation, following a little...
Practical Javascript, DOM Scripting, and Ajax ProjectsPractical Javascript, DOM Scripting, and Ajax Projects picks up where Beginning JavaScript with DOM Scripting and Ajax left off. Frank...
Beginning JavaScript with DOM Scripting and AjaxBeginning JavaScript with DOM Scripting and Ajax will take you from knowing absolutely nothing about JavaScript to being able to manipulate...
Ajax script resourcesWorking with Ajax? (Asynchronous Javascript and XML) Especially in web applications? Check out the web applications and scripts, coding...
Record a web-browsing session using neato AJAX-powered “web recorder”This is an application which feels like it must surely have a useful purpose. I’m not totally sure what that use would be though....
WEB 2.0
yWriter 4Fiction writers can always benefit from useful tools that are free. Keeping track of story lines and characters can sometimes become...
Microsoft Office Live WorkspaceAlthough Microsoft can produce some well functioning products, there are times that they miss the mark completely. As technology moves...
AIM 6.5I love using instant messaging programs because they provide me with an always on instant access. Instead of playing email or phone...
Apple Safari BrowserSearching for the perfect browser can sometimes be a headache. Although there are several available to use, not all of them are created...
Adobe Photshop Express- Free online beta versionAs a digital photographer, I am always looking for a great photo editing tool. Despite the wonderful praises given to Adobe Photoshop,...




