Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I'm aware this doesn't directly answer your question but if you are "not too great" with javascript I would recommend just going straight to jQuery instead of messing with the lower level objects.</p> <p>It will also help you with cross browser compatibility.</p> <p><a href="http://jquery.com/" rel="nofollow">http://jquery.com/</a><br/> <a href="http://api.jquery.com/category/ajax/" rel="nofollow">http://api.jquery.com/category/ajax/</a></p> <p>However if you have a particularly boring day some time in the future, going back and learning what's going on behind the scenes is always beneficial.</p> <p>This would be a simple ajax post using jQuery (with a text response):</p> <pre><code>$.post( "test.php", { postValue1: "hello", postValue2: "world!" }, function(data){ alert("Success: " + data); }, "text"); </code></pre> <p><br/> <hr/> To answer your second question (in comments), the code looks correct but perhaps you're getting a bad response. You can attach additions events onto the ajax call to get additional information.</p> <p>This code is borrowed and modified from jQuery's site:<br/> <a href="http://api.jquery.com/jQuery.post/" rel="nofollow">http://api.jquery.com/jQuery.post/</a></p> <p>I got the function parameter info from:<br/> <a href="http://api.jquery.com/jQuery.ajax/" rel="nofollow">http://api.jquery.com/jQuery.ajax/</a></p> <pre><code>// Assign handlers immediately after making the request, // and remember the jqxhr object for this request var jqxhr = $.post("example.php", function() { alert("success"); }) .success(function(data, textStatus, jqXHR) { alert("second success"); }) .error(function(jqXHR, textStatus, errorThrown) { alert("error"); }) .complete(function(jqXHR, textStatus) { alert("complete"); }); </code></pre>
    singulars
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      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