Global variable in javascript not working properly
<p>I have an iframe issue ( little bit strange for me ) . The issue is that i have an iframe in my document, and there are several functions are operating different task on that iframe and for accessing the contents of iframe we use :</p>

<pre><code>$("iframe").contents();
</code></pre>

<p>So instead of writing this long statement i used a global variable :</p>

<pre><code>var i = $("iframe").contents();
</code></pre>

<p>But this is not working well, like</p>

<pre><code>alert( i.find("someelement") );    
</code></pre>

<p>=> <code>undefined</code> </p>

<pre><code>alert($("iframe").contents().find("someelement")    
</code></pre>

<p>=> <code>[object]</code></p>

<p>Whats the problem here?</p>
