This variable(and also AJAX) is claimed to gain the advantage that it can dynamically gain new response from the server, without reloading the page, whenever the client POST or just the XMLHttpRequest variable constantly get (like polling?), Am I correct?
So what is the mechanism of the XMLHttpRequest GET?, it waits until server sends back response?
Also, is all values shown on the page, that comes from XMLHttpRequest’s response, dynamic?
That means as it changes value, the display value on the page changes as well dynamically without reloading the page?
Can give me the actual Javascript code examples to the concepts to me, Thanks!
It is asynchronous (the A of AJAX), which means you can continue doing other stuff inside the page while the server is processing the request.
The response is static (typically an XML or JSON object which you need to parse through Javascript), if you want to dynamically change content then you will need to perform multiple XmlHttpRequest requests.
Nowadays, most developers do not instantiate XmlHttpRequest objects because there are many wrapper functions like jQuery AJAX (http://api.jquery.com/jQuery.ajax/) which simplifies the creation of the request, headers, content and request callback declaration.