--JAVAscriptで呼び出すカウンタスクリプト --解説 http://mizusawa.no-ip.com:8080/js_as_counter/index.html --Tanaka's OSAX 2.01が必要です。 --ver0.1 2003/11/30 最初のバージョン property thisDir : "" --スクリプトのあるディレクトリが入る property countFile : "indexCount" -- ★★★ カウントファイル名初期化 ★★★--------------設定必須 property crlf : (ASCII character 13) & (ASCII character 10) on run set thisDir to (":" as alias) as string --パス取得 --自動取得↑がうまくいかない場合は↓手動で設定してね。 --set thisDir to "" --スクリプトのあるパス end run on handle CGI request try set oldNum to (MT Read File (thisDir & countFile)) --カウンタファイルの読込 set newNum to oldNum + 1 on error --ファイルがなかったら set newNum to 1 end try MT Write File newNum to file (thisDir & countFile) --カウンタファイルに上書き --表示処理 --set retJava to "Content-Type: text/javascript" & crlf & crlf set retJava to "document.write('" & newNum & "');" & crlf return retJava end handle CGI request