Run function defined as VAR
<p>I ran into <a href="http://stackoverflow.com/questions/3818063/dont-load-hidden-images?answertab=votes#tab-top">Don&#39;t load hidden images</a> ... and wanted to run the funtion <code>reveal</code>.</p>

<pre><code>$(function () {
       $("img").not(":visible").each(function () {
           $(this).data("src", this.src);
           this.src = "";
       });

       var reveal = function (selector) {
           console.log("Viser billeder");
           var img = $(selector);
           img[0].src = img.data("src");
       }
    });
</code></pre>

<p>But how?</p>

<p>If I do this:</p>

<pre><code>reveal();
</code></pre>

<p>It returns this in the console:</p>

<pre><code>reveal is not defined
</code></pre>

<p>How should I call this??</p>

<p>Thank you in advance.</p>
