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 8210031
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T09:56:12+00:00 2026-06-07T09:56:12+00:00

I have created a php class which is pretty expensive and needs to process

  • 0

I have created a php class which is pretty expensive and needs to process a lot of request on an admin page. For this reason I’m trying to using jquery queing + ajax calls to batch process the requests however the whole javascript is not firing and I don’t understand why. I’m more of a PHP expert nog so much js or jQuery.

The code:

<script type="text/javascript">
$(document).ready(function () {
  window.queue = $.jqmq({
    // Queue items will be processed every 250 milliseconds.
    delay: 500,
    // Process queue items one-at-a-time.
    batch: 10,
    // For each queue item, execute this function.
    callback: function (model, apit) {
      $.ajax({
        url: 'script.php',
        type: "post",
        cache: false,
        data: "model=" + model + "&api=" + apit,
        success: function (data) {
          $(".error_msg p").append(data);
        }
      },
      // When the queue completes naturally, execute this function.
      complete: function () {
        $.ajax({
          url: 'script.php',
          type: "post",
          cache: false,
          data: "cleanup=1",
          success: function (data) {
            $(".error_msg p").append(data);
          }
          $('.error_msg p').append('<br /><span class="done">Queue done<\/span>');
        }
        });
      //the next line is repeated a couple hundred times with different values  
      queue.add('arg1', 'arg2'); queue.add('arg1', 'arg2');
      });
</script>

This code is located in the body.
Scripts included (in the head) are:

<script type="text/javascript" src="js/jquery-1.4.1.js"></script>
<script type="text/javascript" src="js/jquery.ba-jqmq.js"></script>

I’ve checked with TamperData FF plugin and the ajax posts to script.php are just not firing and I have no idea why..

  • 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-07T09:56:15+00:00Added an answer on June 7, 2026 at 9:56 am

    In the jqmq documents it says that the callback method accepts a single argument. You’re trying to send more. The second parameter of the add method is for priority and can only be a boolean.

    queueObj.add( item [, priority ] );
    

    You should add your arguments as an array or an object.

    I’ve created a Fiddle and it seems to be working fine.

    UPDATE:
    Also, I believe simultaneous ajax request are limited to 3 or 4, so you won’t be able to have batches of 10.

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

Sidebar

Related Questions

I have created a class file database.php which handles all the sql queries and
I have created a php/mysql based chat page.It is like gmail chat.once i click
I have created a PHP form which requires the user to select a postcode
I have created a RESTful PHP web service using Lithium which contains comments, each
So I have this database class in PHP and I only have 1 function
I have created a Page class and all the pages on my website are
PHP mysql database I have created a follow on question to this one here
I have created a File class, which takes care of all operations on files,
I currently have a custom session handler class which simply builds on php's session
I am using PHP Yii Framework with MongoDB(yiimongodbsuite). I have created a Model which

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.