Skip to main content

Posts

Showing posts with the label ease from difficulty

closures, Ajax, javascript and the hard easy....

A key aspect of AJAX based development is the use of javascript to provide the A in the Jax, all the buzz over web 2.0 is boiled down to one single javascript object now implemented in all major browsers that was first conceived (amazingly) by Microsoft. XmlHttpRequest This object allows the set up of an asynchronous http request, essentially a request that is not tied to the state of the currently requested page resource by the users. Allowing separating of requests from the resource allows us to retrieve resources at different times , hence the that Asynchronous word. Anyway , the object is great , has simple methods for passing in the url and does what it was made to do but because javascript forces some interesting issues to crop up. Closures: In javascript the closures allow a function declaration to persists the current state of a calling function in order to await a response from another objects execution. Since XHR objects process asynchronously they are tailor made to be used...