戻る

(アクセス解析)


サンプルと特長
Access Report


タグの記述例



補足事項
【代替案:その1】
  1. 本来のトップページ index.html を、index2.html にファイル名を変更する。
  2. 以下の内容の index.html をトップページとし、そこにアクセス解析の「タグ」を記述する。

------ index.html ----------------------------------------------
<html>
<head>
<META HTTP-EQUIV="REFRESH" CONTENT="2;URL=index2.html">
<title>TOP PAGE</title>
</head>
<body>

<SCRIPT Language="JavaScript">
<!--
document.write("<img src='http://www.eiwa-up.com/cgi-bin/reports/report.cgi/ID?");
document.write(document.referrer);
document.write("' width=1 height=1>");
// -->
</SCRIPT>

<P align="center">
2〜3秒たってもページが現れない場合は <a href="index2.html">ここをクリック</a>
してください。
</P>

</body></html>
----------------------------------------------------------------



【代替案:その2】
  1. フレームを使用したトップページ index.html にて、「フレームソース」と「アクセス解析」 のタグを JavaScriptで記述する。
  2. フレームはアクセス解析のIMGタグ用に1つ増やす。
    ■変更前
    ------ index.html ----------------------------------------------
    <html>
    <head>
      <title>トップページ</title>
    </head>
    <frameset cols="140,*">
    <frame src="A.html">
    <frame src="B.html">
    
    <norfames>
    フレームが利用できない方は<a href="B.html">ここ</a>をクリックして下さい
    </noframes>
    
    </frameset>
    </html>
    ----------------------------------------------------------------
    
    ■変更後
    ------ index.html ----------------------------------------------
    <html>
    <head>
      <title>トップページ</title>
    </head>
    
    <SCRIPT Language="JavaScript">
    <!--
    document.write("<frameset cols='140,*,1'>");
    document.write("<frame src='A.html'>");
    document.write("<frame src='B.html'>");
    document.write("<frame src='http://www.eiwa-up.com/cgi-bin/reports/report.cgi/ID?");
    document.write(document.referrer);
    document.write("' width=1 height=1>");
    document.write("<noframes>");
    document.write("フレーム利用できない方は<a href='B.html'>ここ</a>をクリック");
    document.write("</noframes>");
    document.write("</frameset>");
    // -->
    </SCRIPT>
    </html>
    ----------------------------------------------------------------
    
    
    注:
    document.write("〜"); の中に記述する「タグ」は、「ダブルクオーテーション」→「シングルクオーテーション」に変更する。
    フレーム枠の定義を「アクセス解析」タグ用に1つ追加する。
    (<frameset cols="140,*"> → <frameset cols='140,*,1'> )


【代替案:その3】
  1. 親フレームの document.referrer は、頭に parent を付けることにより取得できるようです。(IE5, Netscape4.7で確認)。
  2. index.html から A.html, B.html をフレームで呼びだす場合には、A.html 中の Script で parent.document.referrer と記述すると index.html の document.referrer を取得することができます。(ただしブラウザのバージョンによっても違うかもしれません

-----------------修正前-----------------
<SCRIPT Language="JavaScript">
<!--
document.write("<img src='http://www.eiwa-up.com/cgi-bin/reports/report.cgi/ID?");
document.write(document.referrer+"' width=1 height=1>");
// -->
</SCRIPT>
----------------------------------------

-----------------修正後-----------------
<SCRIPT Language="JavaScript">
<!--
document.write("<img src='http://www.eiwa-up.com/cgi-bin/reports/report.cgi/ID?");
document.write(parent.document.referrer+"' width=1 height=1>");
// -->
</SCRIPT>
----------------------------------------