Archive

Posts Tagged ‘XMLHttpRequest’

Checking the XMLHttpRequest Object’s status property – 12

May 1st, 2010 No comments


www.ajaxtraining.blogspot.com -Checking the XMLHttpRequest Object’s status property.We can check for an objects state to see where it’s at to decide if we can output the result or not, we can combine this with a test for the HTTP status of a download to see if it was successful, we can check for a value of 200 which means everything went ok. (a value of 404 would mean file not found just like normal HTTP status codes). To use the readystate property, just bang it on the end of the object name and put that in an ‘if’ statement. Ie… if (XMLHttpRequestObject.readyState == 4 && XMLHttpRequestObject.status == 200) {do something} (the && means AND, so we check the readystate AND the status, if they are BOTH correct then execute the code in the curly brackets) To put that in the code of the last tutorial, replace the bit that outputs the message about the oranges box being collected with an anonymous function that is attached to the objects readystate. It’s not named an anonymous function because it has a secret identity, it is just a nice way of running a function with no name when a certain thing happens like the objects’ readystate being changed.

Checking the XMLHttpRequest Object’s readyState property 11

May 1st, 2010 No comments


ajaxtraining.blogspot.com Checking the XMLHttpRequest Object’s readyState property he XMLHttpRequest object has a special property called onreadystatechange. onreadystatechange stores the function that will process the response from the server. The following code defines an empty function and sets the onreadystatechange property at the same time!Visit my blog

Creating an XMLHttpRequest Object in JavaScript – 10

May 1st, 2010 No comments


(Find more about AJAX at ajaxtraining.blogspot.com ) Creating an XMLHttpRequest Object in JavaScript. A hybrid method for creating a cross-browser compatible XMLHTTPRequest object for AJAX transactions.

AJAX Video Tutorial 14 – Problems creating an XMLHttpRequest Object

April 30th, 2010 No comments


For More Video Tutorial Visit vtutorial.freehostia.com

Handling Multiple XMLHttpRequest Requests – Ajax Power – 32

April 30th, 2010 No comments


www.ajaxtraining.blogspot.com – Handling Multiple XMLHttpRequest Requests – Ajax Power