Why does jquery ui dialog mangle my jquery.tokenin

2019-06-10 07:36发布

问题:

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