im making a call to load function which dynamically loads a part of the jsp. after the load functionm call i notice that the autocomplete on a input box is not being responsive. it was fine earlier before the load function call. The load function replaced a a div with the given id and the autocomplete textbox already exists before the load call. the following is the code for my autocomplete. please help

$('.directoryAutoComplete').autocomplete({
    source : system.ctx+ '/autocomplete/people',
    focus : function() {
        return false;
    },
    select : persons.autocompleteSelected,
});
有帮助吗?

解决方案

You have to reattach the autocomplete after you dynamically load the new html. When you swap out the html you've removed the autocomplete as well as the old html.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top