Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8568105
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:02:01+00:00 2026-06-11T18:02:01+00:00

A quiz form is completed by the user and the Score Quiz link is

  • 0

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.

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.

What might be going on?

    jQuery('#checkQuiz').click(function(){
        var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>';
        // 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;
    });

NOTE 1: I was able to catch an error in the Firebug console:

NS_ERROR_XPC_NOT_ENOUGH_ARGS: Not enough arguments [nsIDOMLocation.replace]

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.

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 WordPress.org troubleshooting forum in case someone there doesn’t visit stackoverflow.

NOTE 3: I tested this with the standard theme for wordpress “twentyeleven”. The same error occurred. I am running out of options to test.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T18:02:03+00:00Added an answer on June 11, 2026 at 6:02 pm

    After testing and decomposing the code involved, the error was found in the data array passed into the ajax call. To aid anyone seeking answers for a similar error here is what I found in the code.

    quizData is an array structured for the WordPress ajax handler.

    Code As Found

    var quizData = {
        action: 'save_quiz',
        item: invoice_item,
        lesson: jQuery("#lesson"),
        score: ratio };
    

    There are two problems with this code. First, the jQuery call is assigning a jQuery object to the array value element “lesson”. This results in an “undefined” value in the array that creates the error condition. The missing bit here is the “.val()” function invocation.

    The second one may be the code architecture of the project, but it appears that a jQuery call within array assembly block does not work as expected. In my tests, the data array contained an empty value.

    Resolution

    var lesson_id = jQuery("#lesson").val();
    var quizData = {
        action: 'save_quiz',
        item: invoice_item,
        lesson: lesson_id,
        score: ratio };
    

    I hope this helps someone.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have this form, sent via jQuery ajax, but I'd like to validate
I am trying to use jquery validate plugin on my 5 questions quiz form.
I have a form as shown in PHP where user can build a quiz
When submitting a form using jQuery and AJAX, I am getting a 403 error
I am generating a form for answers to a quiz. Since the answers will
I am making a quiz app for chemistry reactions. The app gives the user
I am coding a quiz module, which contains a radio button set, using jQuery
I have a group of radio buttons in a multiple select quiz form and
I am trying to do some dynamic form post to server something is organized
I'm going to make simple quiz form on site. Are there ways to make

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.