Note that there are some explanatory texts on larger screens.

plurals
  1. POAjax call in WordPress causes unwanted page reload and aborts fancybox presentation
    primarykey
    data
    text
    <p>A quiz form is completed by the user and the "Score Quiz" link is clicked. What is wanted is for the score to be tallied, results sent to server via jQuery ajax call, and the fancybox presenting the user notice.</p> <p>What is happening is the tally is done and the ajax call is initiated and the page reloads. If I comment out the ajax call, the fancybox appears as desired. Using Wordpress 3.4.2.</p> <p>What might be going on?</p> <pre><code> jQuery('#checkQuiz').click(function(){ var ajaxurl = '&lt;?php echo admin_url('admin-ajax.php'); ?&gt;'; // tally correct answers var quizData = tallyScore(); // display user notice jQuery('a#hiddenAnchor').trigger('click'); // store the data while the user is reading the results display jQuery.ajax({ type:"post", url:ajaxurl, data:quizData }); return false; }); </code></pre> <p>NOTE 1: I was able to catch an error in the Firebug console:</p> <pre><code>NS_ERROR_XPC_NOT_ENOUGH_ARGS: Not enough arguments [nsIDOMLocation.replace] </code></pre> <p>The file reported is jQuery.js and that appears to be a version 1.7.2. I noted that jQuery current release is 1.8.1. I wonder if that is part of the problem.</p> <p>NOTE 2: I forgot to mention that this code is part of page template in a child theme. Similar ajax calls made on other pages in the web app work fine. I added a post to the <a href="http://wordpress.org/support/topic/jquery-ajax-call-fails-on-ns_error_xpc_not_enough_args?replies=1" rel="nofollow">Wordpress.org troubleshooting forum</a> in case someone there doesn't visit stackoverflow.</p> <p>NOTE 3: I tested this with the standard theme for wordpress "twentyeleven". The same error occurred. I am running out of options to test.</p>
    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. 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