私は3つのhtmlファイルと3つのjsファイルを持っています
index.html、rank.html、score.html
global.js、rank.js、score.js
index.htmlには、iframeを使用してrank.htmlとscore.htmlを含めました。
global.jsで、Varランクを宣言しました。&global.jsはrank.html&score.htmlに含まれています。
rank.jsのrankの値を更新していますが、score.jsの更新された値にアクセスしたいと思います。score.jsでは、更新された値を取得できません。これにより、未定義の値が得られます。
スコア.htmlにrank.jsを含めたくないので、global.jsを作成してhtmlファイルに含めました。
これが私のコードです、
Index.html
<html>
    <head>
    </head>
    <body>
<iframe src="../rank/rank.html" frameborder = "0" scrolling="no" width="50%" height = "100%"></iframe>
<iframe src="score.html" frameborder = "0" scrolling="no" width="50%" height = "100%"></iframe>
    </body>
</html> 
global.js
var rank;
score.js
$(document).ready(
        function(){     
                    setInterval(dataupdate, 10000);
    });
function dataupdate() { 
alert(rank) 
};
ランク.js
$(document).ready(
            function(){     
                        setInterval(dataupdate, 10000);
        });
    function dataupdate() { 
    rank = "first";
    };
スコア.jsファイルのランクの値を更新して、その値にアクセスする方法を教えてください...
ありがとう.....