I’m trying to make my first Jquery widget using the widget factory.
I have 10 functions inside my widget and wanted to declare variables used throughout on _create like so:
(function($,window){
$.widget("mobile.somesome",$.mobile.widget, {
_create: function() {
var self = this,
that = something else, ...
I want to access these variables from within the other functions, but this does not work or more likely… I’m doing something wrong…
Question:
Is it possible to declare variables on a “widget-global” level and if so how can I do it?
Thanks!
You could declare them as properties and them set/access them throughout the widget: