Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私のウェブサイトは、主にホームページのiframeに読み込まれるページで構成されています。ページが読み込まれると、iframeの外部で開かれているかどうか、ホームページであるかどうかが確認されます。
ホームページを開いたときに、この特定のページを開きたいと思います。「ブラウザが由来する」test.htmlの情報を送信するにはどうすればよいですか?次に、iframeのソースをtest.html?に設定します。
test.html
フレームを含むページに、URLのクエリ文字列でフレーム化するページのURLを渡します。
構文
top.document.referrer
iFrameの親にアクセスできるようになります。
document.getElementById('myIframeId').src = myUrl + 'test.html';
iFrameソースを設定します。