In a plugin `this` refers to the current jQuery instance, it's not
your "own" object. Also most plugins return this jQuery instance, this
is what enables chaining.

If you want namespaces check this:
http://groups.google.com/group/jquery-dev/browse_thread/thread/b2f784b7575456dc/0cd276379f8a2f7d?show_docid=0cd276379f8a2f7d

But having a custom object is another story:
http://groups.google.com/group/jquery-en/browse_thread/thread/9dc9be1cc298cbdd

Maybe the nicest way is how jQuery UI solves it:
it stores the instance of the actual widget with $.data:
http://docs.jquery.com/Core/data

So when you call e.g  $(el).tabs('enable')
(which also returns a jQuery object)
it accesses the instance, that is associated with the element:
var inst = $(this).data('tabs');
and then calls the enable method:
inst['enable'];

The easiest is if you just return your own custom object in the plugin
but the downside is that breaks chaining.

On Jan 8, 5:06 pm, WoutervD <woutervandon...@gmail.com> wrote:
> Hello there,
>
> I would like to know how i can access properties of a jQuery object
> instance.
> I have the following 
> javascript:http://paste.pocoo.org/show/U9Gsy68MKP9LvvAvqGI6/
>
> I would like to access the instance from my HTML file and pass value's
>
> <script type="text/javascript">
>     jObject.sValue = "a value :)";
> </script>
>
> How can I do this?
>
> The way jQuery is written confuses me a little (just started using it)

Reply via email to