Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>this is simple Ajax function</p> <pre><code>function check_detail(strURL, pids) { // definning new variable var xmlHttpReq = false; // creating variable self which will function as this var self = this; // creating HTTP request maker for Mozilla/Safari if (window.XMLHttpRequest) { self.xmlHttpReq = new XMLHttpRequest(); } // creating HTTP request maker in IE else if (window.ActiveXObject) { self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP"); } // so this is the confusing part right ? // xmlHttpReq.open opens connection tu the strURL and infomation sending method // will be POST method ( other passible values can be GET method or even else ) self.xmlHttpReq.open('POST', strURL, true); // this defines HTTP request header (small information about what we are sending) // in fact this is sending Content-type of information self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); // when HTTP request maker state will be changed for example: // the data will be sent or data will be received this function will be fired self.xmlHttpReq.onreadystatechange = function() { // readyState 4 means data has been received if (self.xmlHttpReq.readyState == 4) updatepage(self.xmlHttpReq.responseText, pids); // updatepage is user defined function } // this actually sends the HTTP request which is made above // but don't be confused because of this code ordering // I mean the function defining what to do when content will be received is implemented // before sending HTTP request right ? // thats because if the data is too small and internet is really fast HTTP query can be // executed faster then defining new function which will cause javascript error self.xmlHttpReq.send(getquery(pids)); } </code></pre> <p>hope this helps if not more about ajax: <a href="http://en.wikipedia.org/wiki/Ajax_(programming" rel="nofollow">http://en.wikipedia.org/wiki/Ajax_(programming</a>)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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