jquery - message queuing + ajax not firing -


I have created a php square which is very expensive and needs to take action on many requests on the admin page. For this reason I am trying to use jquery queing + ajax call for the batch process, but although I am not fully fishers javascript and I do not understand why. I am a js or jal more than a php expert nog.

Code:

  & lt; Script type = "text / javascript" & gt; $ (Document) .ready (function () {window.queue = $ .jqmq ({// queue item will be processed at every 250 milliseconds. Delay: 500, // process queue item one-by-one Batch: 10, // For each queue item, execute this function. Callback: Function (model, off) {$ .ajax ({url: 'script.php', type: "post", cache: incorrect, Data: "model =" + model + "& amp; api =" + apit, success: function (data) {$ (". Error_msg p"). Attachment (data);}}, // When queues naturally Complete, this f Function () {$ .ajax ({url: 'script.php', type: "post", cache: incorrect, data: "cleaning = 1", success: function (data) {$ ( ". Error_msg p") .append (data);} $ ('error_msg p') .Append (' & lt; span class =' ​​done '& gt; Qi done & lt ; \ Span & gt; ');}}); // The next line is duplicated in two rows, with different values ​​queue.add (' arg1 ',' arg2 '); queue.add (' arg1 ' , 'Arg2');});   

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

  & lt; Script type = "text / javascript" src = "js / jazzery-1.4.1.js" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" src = "js / jquery.ba-jqmq.js" & gt; & Lt; / Script & gt;   

I checked with the TamperData FF plugin and Ajax posts of script.php are not just firing and I do not know why .. < P>

It says that callback method accepts a single argument. You are trying to send more. The second parameter of the add method is for priority and can only be boolean.

  queueObj.add (item [priority]);   

You should add your arguments as an array or object.

I have made one and it works fine.

Update: Apart from this, I believe that Ajax requests are limited to 3 or 4, so you will not be able to do 10 batches.

Comments