I am using jQuery UI factory widget.
$.widget("myPlugin" , { options: { }, _create: function() { }, instanceVar: "huzzah!" });
In testing, it looks as if instanceVar is actually part of the prototype. So this is the same in all instances of the plugin.
I can fix this by adding instanceVar to the parameters, for example:
$.widget("myPlugin" , { options: { instanceVar: "huzzah!" }, _create: function() { }, });
However, this seems strange, since instanceVar is just an internal variable for use by the plugin - not that the plugin user should be able to modify.
Is there any other (better) way to achieve this?
Thank you for your help!
user1031947
source share