And by specifically when I say updating a page's content, I'm not saying we rewrite the page using JavaScript. I'm saying we actually request more information from the server without our page having to reload.
Now, it's very easy to do this. We just say var, whatever we want to call this object, equals new XMLHttpRequest.
And now we have now obtained an AJAX sort of object, or an XMLHttpRequest object, which will allow us to asynchronously update our page.
After we have gotten this new object, this XMLHttpRequest, we have to do something to its onreadystatechange behavior.
Onreadystatechange behavior is really just when you make a request to a web page, the page goes through a number of steps.
First, a request hasn't been sent.
Then, the request has been sent, but not acted upon.
Then the request has been acted upon.
Then the request is being sent back to you.
Then, the request is fully loaded in your page.
Those are different states.
So what does this maybe look like in context?
So here's a function that deals with AJAX requests.