I am developing a framework of jquery widgets for a new project. They are created by the $.widget factory and they work well using $("selector").myWidget(myOptions). I want to avoid possible name collisions and prefer using the form $.myNamespace.myWidget(myOptions, mySelector)
, but an error is thrown when the selector matches no element on page: owner is undefined, that I traced to the line 3649, on jquery-2.2.0 (function acceptData).
For reference, I've already read (and I think I understood):
- http://api.jqueryui.com/1.10/jQuery.widget/
- http://learn.jquery.com/jquery-ui/widget-factory/extending-widgets/
This question was also posted on stackoverflow.
Do you have any thoughts?