-2

私はwc.htmlを持っており、次のコードを含むindex.htmlを持っています。

<!doctype html>
<html>
    <head>
        <meta charset="utf-8">
        <title>My title</title>
    </head>
    <frameset rows="*">
        <frame src="wc.html">
    </frameset>
    <noframes></noframes>
    <body>
    </body>
</html>

また、wc.htmlをインデックスではなく個別に表示すると、インデックスページにリダイレクトされるようにしたいと思います。

それ、どうやったら出来るの?前もって感謝します。

4

2 に答える 2

0

あなたはこれを試すことができます:

var location = window.location.href;
    if(location.indexOf('wc') != -1 || location == undefined){
        window.location.href = "index.html";
    }
于 2013-03-22T08:13:25.760 に答える
0

これを試して、

if(window.parent.location.href==undefined){
   window.location="index.html";
}
于 2013-03-22T07:42:00.783 に答える