views:

59

answers:

0

I have this AjaxQueue that i am trying to implement but I am having problems and even looked at the documentation and I am still unclear on how to implement it. I read it twice and still having troubles

Here is my code:

I want to wrap this in the Queue manager

$('#request_artist').autocomplete({
  serviceUrl: '<%= ajax_path("artistName") %>',
  minChars:1,
  width: 300,
  delimiter: /(,|;)\s*/,
  deferRequestBy: 0, //miliseconds
  params: { artists: 'Yes' },
});

The code for creating one is there but i dont see the code to cancel or abort and do i just put this code in here

//generate an ajaxmanger named clearQueue 
$.manageAjax.create('clearQueue', {queue: 'clear', maxRequests: 2}); 
//and add an ajaxrequest with the name parameter 
$.manageAjax.add('clearQueue', { success: function(html) { $('ul').append('<li>'+html+'</li>'); }, url: 'test.html' });

but where does my code go and how do i abort the concurrent requests