Hey Peeps!
been doing a bit of jquery latley and decided to implement some into my live site,
now i know this is probably the most basic thing that i am missing, but i need some sort of stop() in my code, thing is, im not too sure where to put it when it comes to ajax.
$('#company').onblur(function(){
$('#getcon').append('<img src="../img/loading.gif" id="loading" alt="loading" />');
var comID = $('#company').val();
$.ajax({
url : 'getcon.php',
type : 'POST',
data: 'comID=' + comID,
success : function(result){
$('#response').remove();
$('#getcon').append(result);
$('#loading').fadeOut(500,function(){
$(this).remove();
});
return false;
}
});
});
that is my jquery to a php file which retrieves a
<select></select> with the options that are 100% spot on, only thing is that it keeps appending selects everytime i click/keydown/blur.
Hope this is all readable and im making sense :)
any help will be greatly appreciated! :)