Why does jquery ui dialog mangle my jquery.tokeninput.js autocomplete?

淺唱寂寞╮ 提交于 2019-12-23 04:52:33

问题


I am using the snazzy jquery tokeninput plugin and jquery ui. When I display a form with a token input in it, rather than displaying the token input correctly, it loses some styling and splits into two input boxes. I've made a repro page (linked below) which mangles it.

Why is it doing it, and what can i do to fix it?

example repo html doc here: http://dl.dropbox.com/u/2808109/jquery%20dialog%20tokeninput%20demo.htm

edit: have found the answer


回答1:


It looks like dialog re-runs the script tags in the block of code so my autocomplete is executing twice.

my fix was to remove the script tags in the code I was dialoging

$("#popup script").remove();
$("#popup").dialog({ ... });


来源:https://stackoverflow.com/questions/6669654/why-does-jquery-ui-dialog-mangle-my-jquery-tokeninput-js-autocomplete

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!