jQuery ui widgets require a minimum amount of html to be instantiated. When instantiating, the widget's create method is called which should render the full html and add any required classes.
The recommended place to instantiate widgets is in the document ready handler. This is causing me some issues because in old (slow) browsers or just slow pc's the user can see the page changing (flickering).
In the past i've always been able to overcome this problem by simply rendering the full html, including all the css classes. But now in jquery ui 1.10 this is no longer working for all widgets. Currently trying to do this with the accordion widget and the cornering breaks when i pre render the html.
Putting the instantiation right below the html is not always an option either because some widgets do positional calculations in the create method which gets corrupted if the page has not been loaded completely.
Apparently the jquery ui team and the ui mobile team for that matter don't seem to recognize this problem. I don't really understand why that is because it makes for a less smooth user experience.
I have several custom plugin that can have elements passed into the options. As per convention these elements can be either a selector, dom element or jQuery object.
In order to make that convention fly i create jQuery objects for all elements passed through options.
But i'am not sure this is the best approach because the options the user passes in get changed.
Also because it's converted to a jQuery object the user can pass in multiple elements and sometimes this gives an undesired effect.
So my question is; how to go about passing elements though options in a custom plugin? Is it ok to convert those options to jQuery objects and how to deal with users passing multiple elements when you only want one element?
We are using the unobtrusive validation library that using the standard jquery validation plugin.
This extension adds a handler to document ready which parses the document for validation meta data.
$(function () {
$jQval.unobtrusive.parse(document);
});
For our application this behavior it not wanted so i ended up commenting out the code shown above. But i don't want to modify standard libraries because that bring in complications when upgrading to a newer version.
What i want to do is unbind the last bound document ready handler after the unobtrusive libary loads.
Is there a way to unbind the handler in the code shown above?