XHR is an acronym for XmlHttpRequest. It doesn't actually force you to transfer only XML data, though it was meant for that from the beginning. XHR techniques is the reason Ajax is called Ajax. Ajax - Asynchronous JavaScript And XML.
The idea behind Ajax is to make it possible for scripts inside the web page to send and retrieve data to and from the server without having to reload the page. A side-effect of this is that the page can retain state between data transfers without having to rely on cookies (although the methods can be combined).
In practice, what happens is that the browser opens a new iframe with zero height and width. Each iframe is capable of loading and posting data independently of each other, and so the accesses of the 'invisible' iframe will not affect the main page to be reloaded.
This results in a page whose JavaScript functions are able to post a form and get a reply, which in turn updates only part of the page, flicker-free, so to speak.
The function...