How to get jQuery UI to work from a Firefox extension
I've tried to engage with the jquery and jquery ui communities (email list, irc), in addition to Google and more experienced coworkers, but nothing has proved fruitful. I've found stackoverflow useful in the past, so perhaps someone will have encountered this before.
My problem is this: I want to include jQuery UI in my extension.
This isn't as simple as in self served page scripts because I need to provide a specific context to the ui widgets.
jQuery can be initialized with a specific context. jQuery UI cannot. Thus, I wrapped the UI code with a function that takes in the correctly contextualized jQuery instance.
PROBLEM: whenever UI code creates a jQuery instance, eg $(""), this.element is overwritten to be that newly created element.
this.element is supposed to be, for instance, the slider div. When the slider widget initial开发者_如何学Goization creates the handle div, this.element is still supposed to be the slider div, not the handle....appending the handle to itself correctly raises an error.
the "this" in the widgets might be messed up...jQuery UI or jQuery might refer to itself directly somewhere, and thus the contextualized jQuery I'm providing isn't getting used everywhere...jQuery UI might not be re-entrant or something of that sort... I have no idea.
I would be super grateful for any help you can provide. I've been learning a lot from debugging this problem....but I'm definitely ready to get this working and move on already.
The post I made to jQUery UI's mailing list includes relevant code snippets http://groups.google.com/group/jquery-ui/browse_thread/thread/a79537053acff3f8
ps - Let's say we can't fix this problem. What would you do? Right now I just want to get sliders to work. Not sure about the future, eg effects? datepicker?
精彩评论