dポイントプレゼントキャンペーン実施中!

C.htmlにてリファラを取得したいのですが、
document.refferでは、B.htmlのURLが取得されてしまいます。
A.htmlを取得したい場合、B.htmlでリファラを取得し、C.htmlへ引継ぐことで
可能でしょうか。
また、どのような方法となるのでしょうか。
ご教授下さいませ。

リンク元:A.html
フレーム:B.html
フレーム内:C.html D.html

<html>
<frameset cols="100,*">
<frame src="C.html" name="C">
<frame src="D.html" name="D">
</frameset>
<noframes>
このページはフレームを使用しています。
</noframes>
</frameset>
</html>

A 回答 (1件)

いくつか方法がありますが、単純なのは



<html>
<script type="text/javascript">ref = document.referrer;</script>
<frameset cols="100,*">
<frame src="C.html" name="C">
<frame src="D.html" name="D">
</frameset>
<noframes>
このページはフレームを使用しています。
</noframes>
</frameset>
</html>

これでC.htmlやD.htmlでは
top.ref または parent.ref
でrefの値を参照できます。
    • good
    • 0

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!