Within my jQuery plugin execution flow I render this sidebar list of links.
//render method
var render = function(self){
var sidebar = '';
var main = '';
/* Sidebar */
sidebar += '<ul>'
sidebar += '<li><a href="javascript:self.data(activeFolder,1);self.data(render);">Rootobject 1</a></li>';
}
Only I don't want the link to print out self
, but I want a reference to the object referenced by self instead.
------------- UPDATE ------------
I'll try to explain my problem in a different way.
If I had been working with this plugin from the body of the page, I could easily store a reference to it upon init
var myPlugin = $('.some-element').myPlugin();
and later do this:
<a href="javascript:myPlugin.render();">Rootobject 1</a>
Now, I want my plugin to prepare that same link, so how can I write a refrence from within the plugin to substitute the myPlugin var in this example above?