First of all let me say hello to the entire jQuery community !
Few days ago i tried to create a plugin and then i run into a problem, which i couldn't solve.
This is how i would like to call the plugin:
Initialization:
$(selector).uploader({ // param options });
Setter:
$(selector).uploader('option','param', value);
Getter:
$(selector).uploader('option','param');
The problem:
Let's say that we call the function for the following elements:
$('a.smth, div.smth').uploader(); // this loads the default options ( ajax:false );
Let's set the a.smth ajax to true:
$('a.smth').uploader('option','ajax',true);
Then i want to get the values:
$('a.smth).uploader('option','ajax');
$('div.smth).uploader('option','ajax');
The problem is that both print "true"
I know the problem comes from the scope of the variable that holds all the parameters. If i declare it private i can't access it using $('a.smth).uploader('option','ajax'); if i declare it global it overrides the past values.
Ideal would be to set this variable to each jQuery object. Is this possible ?
Any ideas will help.
Thank you so much