JamesBarnsley
(Jamesbarnsleyfreelance)
1
Why does the ajax call of the this code keep on repeating (looping)
$("#member_add").bind( "autocompleteselect", function(event, ui) {
$.ajax({
url: "<?php echo Yii::app()->request->baseUrl; ?>/member/updatememberinfobox/query/" + ui.item.value,
cache: false,
success: function(html) {
jQuery("#member-info-box-add").html(html);
}
});
});
It just gets called over and over again and does not stop.
Any ideas why?
P.S.
I have tried this and it does not keep repeating alert "Hi" …
$("#member_add").bind( "autocompleteselect", function(event, ui) {
alert("hi");
});
So I do not think it is the outer loop.
marcovtwout
(Marco van 't Wout)
2
Try commenting out: jQuery("#member-info-box-add").html(html);
It looks like you are rendering html which calls the autocompleteselect event again.
JamesBarnsley
(Jamesbarnsleyfreelance)
3
Ok I have tried it but it has made no difference, any other ideas?