Ok so I have an autocomplete field that is making an ajax request every keystroke....which can slow things down alot. If you visit here and use the
email: [email protected] pass: test12
If you have firebug open and start typing fast you will see all the see all the ajax requests. My question is can i cancel the previous request if there is a more recent one. here is my code.
This is my autocomplete call using this plugin
$('#request_artist').autocomplete({
serviceUrl: '<%= ajax_path("artistName") %>',
minChars:1,
width: 300,
delimiter: /(,|;)\s*/,
deferRequestBy: 0, //miliseconds
params: { artists: 'Yes' },
});
From there I call the ajax from my rails application using
from my rails action I make a call to the itunes api
http://ax.itunes.apple.com/WebObjects/MZStoreServices.woa/wa/wsSearch?term=metalicca
really my question is, Is there a way to tell if an ajax is running and kill it