Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>It's very hard if not impossible to answer this question on the basis of the information you've given, but: Perhaps you're talking about the <a href="http://en.wikipedia.org/wiki/Xmlhttprequest" rel="nofollow noreferrer"><code>XMLHttpRequest</code></a> object. It's job is to send a GET or POST (or sometimes other verbs) request to the server and receive the response, without doing a page refresh. For instance, when you submit a comment on a question or answer here on StackOverflow, an XHR (as they're frequently called) is used to send your comment to the server rather than requiring the entire page to be reloaded.</p> <p>XHR isn't very hard to use directly, but it's even easier to do this if you use a library like <a href="http://prototypejs.org" rel="nofollow noreferrer">Prototype</a>, <a href="http://jquery.com" rel="nofollow noreferrer">jQuery</a>, <a href="http://code.google.com/closure/library" rel="nofollow noreferrer">Closure</a>, or <a href="http://en.wikipedia.org/wiki/List_of_JavaScript_libraries" rel="nofollow noreferrer">any of several others</a> that will handle some browser idiosyncracies for you and generally make the API a bit simpler.</p> <hr> <p><strong>Edit</strong> Based on your updated question:</p> <p>My guess was probably correct: <code>ajaxObj</code> is probably an instance of <code>XMLHttpRequest</code>, since <code>responeText</code> is one of the <code>XMLHttpRequest</code> properties. (Or it might be a Prototype <code>Ajax.Response</code>, as they used the same name; other frameworks may have done something similar.)</p> <p>What that code is doing is checking to see if the <code>ajaxObj</code> variable refers to something and, if so, the code replaces the content of the <code>divResult</code> div with the markup that the server sent back in response to the request (looking up the element by ID and then setting its <code>innerHTML</code> property).</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload