increment variable using jquery
<p>I feel like this is a pretty basic thing, but I cant seem to find the solution.  Im trying to increment a value after the loading of an IFRAME.</p>

<p>the code looks like this:</p>

<pre><code>var x=0;
$(document).ready(function() {
        $('#iframe-2').load(function() {
            var x=x+1;        
        });
        $('#iframe-3').load(function() {
            var x=x+1;    
        });
        $('#iframe-4').load(function() {
            var x=x+1;        
        });
        $('#iframe-5').load(function() {
            var x=x+1;        
        });
    });
</code></pre>

<p>What I want to do is give a number of loaded iframes that updates when an iframe completes its loading.  The output code is like this currently:</p>

<pre><code>&lt;script language="javascript"&gt;
document.write(x + " Results");
&lt;/script&gt;
</code></pre>

<p>thanks a ton in advance for any help!</p>
