So here is the code I'm using:
$(function(){
$('<div id="info" style="width:auto; height:auto;"/>').load('test.php?var='+d+' #se', function() {
$('#main').append(this);
});
});
}
Now, when I run the function (with the keyboard in the input field), the loaded div is added again and again to each keyup event.
I use jQuery 1.5 - in older versions, namely 1.2.6, the div was not added after the first time, and it worked fine (error?).
How to prevent div from being added over and over? (disable the "trigger", unfortunately, is not an option). I also tried appendTo, which is pretty much the same problem.
Someone will help me! Many thanks
source
share