this afternoon, i spent some time between classes working on my web apps assignment, by the end i had my writing functions, some basic layout, xml and asp files ready and working. I planned to wait until i came home tonight to get the reading and tweet printing functions working, then work ont he logins.
When i got home tonight, i found that my page would no longer write to my xml file, and in fact seemingly took no action whatsoever when my button was pressed. I spent hours trying to remedy this problem, but in the end decided to start anew, using the example given to us in class, and adapting it. At first even the example did not behave as it should, but when it finally did, i saved a copy as backup, to return to in case the same problem occurred.
Sure enough, at around 11:30pm some additions i had made to one of my copies seemed to have stopped it from working, so, i removed them, but still nothing. Next i returned to my backup, and opened it in my browser… WTF! Nothing, no errors, but also no script, nothing new in the xml, no changes to the text areas, no alerts. So once again I’m stuck with a seemingly static webpage, and no idea as to how to make it work, or even why these intermittent problems are occuring.
Filed under: Web Applications | Tags: Active X, AJAX, browser, Firefox, Internet Explorer, javascript, xml
AJAX, or Asynchronous Javascript and XML is a collection of standardized web tools which can be used for manipulating web applications and webpages. While it has existed for over a decade, the name “AJAX” only came into use in 2005. The fact that it operates “Asynchronously” means that while traditional webpages would be updated completely upon user input, AJAX pages are able to request and manipulate data in specific areas of the page, while retaining much of the page.
To do this, AJAX uses the XMLHttpRequest object, which queries the specified server for the information to be updated. Internet Explorer and Firefox both handle these objects differently; while IE requires it to be called as an ActiveX object, FF allows the XMLHttpRequest to be an object in its own right.
To check the progress of these requests, and perform actions based on it, there exists the property “readyState”. This can have a value from 0 to 4, corresponding to the states from initialized to complete. Using this property, functions can be set to run, for example, when the process is at state 2, or when it has been sent.
It can be seen that the XMLHttpRequest is a powerful tool for web development, allowing for faster loading, more efficient and powerful web pages and applications.