How do I add a version number to a jQuery UI Widget
I have created a new jQuery UI Widget and wanted to add a version so that if my API changes in the future, users can react appropriately based on the stated version of the widget. In the core widgets the developers used $.extend()
to add a public version var开发者_StackOverflowiable:
$.extend($.ui.dialog, {
version: "1.8.11",
...
});
Is this the appropriate method for adding a version identifier to my own widget or should I just include the variable as part of the original widget definition?
how about $.ui.dialog.version
?
I think you best should use somehting like window.myvar={dielog: '1.0',...}
doing it manually :) coz most of the time you'd get the ui version as suppose to dialog version... :) but hope that solves your problem
精彩评论