Pass data to encapsulated javascript code
<p>in my webapp I have a variable like this</p>

<pre><code>var data = {
     getItem: function(key){
         ...
     }
}
</code></pre>

<p>In all of my scripts I can use</p>

<pre><code>data.getItem("Test");
</code></pre>

<p>But how can I use it in <code>jquery plugins</code>? Plugins often have following structure</p>

<pre><code>(function($, window, document) {   
     //....plugin-code
});
</code></pre>

<p>How do I call this kind of structure? Is it possible to use my global data variable in such plugins?</p>
