Access variable from different js file
<p>I Have 3 html files &amp; 3 js files</p>

<p>index.html,rank.html,score.html</p>

<p>global.js,rank.js,score.js</p>

<p>In index.html I have included rank.html and score.html using iframe.</p>

<p>In global.js I have declare Var rank; &amp; global.js included in rank.html &amp; score.html.</p>

<p>I am updating the value of rank in rank.js and i want to access the updated value in score.js. In score.js I dont get the Updated value It gives UNDEFINED value.</p>

<p>I dont want to include rank.js in score.html so i created global.js &amp; included in html file.</p>

<p>Here is my code,</p>

<p>Index.html</p>

<pre><code>&lt;html&gt;
    &lt;head&gt;

    &lt;/head&gt;
    &lt;body&gt;
&lt;iframe src="../rank/rank.html" frameborder = "0" scrolling="no" width="50%" height = "100%"&gt;&lt;/iframe&gt;
&lt;iframe src="score.html" frameborder = "0" scrolling="no" width="50%" height = "100%"&gt;&lt;/iframe&gt;

    &lt;/body&gt;
&lt;/html&gt; 
</code></pre>

<p>global.js</p>

<pre><code>var rank;
</code></pre>

<p>score.js</p>

<pre><code>$(document).ready(
        function(){     


                    setInterval(dataupdate, 10000);


    });
function dataupdate() { 

alert(rank) 

};
</code></pre>

<p>rank.js</p>

<pre><code>$(document).ready(
            function(){     


                        setInterval(dataupdate, 10000);


        });
    function dataupdate() { 

    rank = "first";

    };
</code></pre>

<p>I want updated value of rank in score.js file how to access that value...</p>

<p>Thanks.....</p>
