简体   繁体   中英

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

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

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({ ... });

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM