问题
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