違うサーバーのファイル
同じサーバーのファイル
同じサーバーのファイル




windowA
[ JavaHouse6290 TEST ]


実験x




<SCRIPT LANGUAGE="JavaScript">
WindowB = window.open ("WindowB.htm","","width=250,height=250");

function chk(href1){

if (navigator.taintEnabled()) {
   alert(href1)
   }else{
   alert('taintの設定してね^^;;')
   }
}

</SCRIPT>

<BR><BR>
<FORM>
<BR><INPUT TYPE="button" VALUE="chk(WindowB.location.href)"
            onClick="chk(WindowB.location.href)">

<BR><INPUT TYPE="button" VALUE="WindowD......WindowB.location.href='http://www.d-d.co.jp/mountain/tato/jhtest/WindowD.htm'"
            onClick="WindowB.location.href='http://www.d-d.co.jp/mountain/tato/jhtest/WindowD.htm'">違うサーバーのファイル

<BR><INPUT TYPE="button" VALUE="WindowB.location.href='WindowC.htm'"
            onClick="WindowB.location.href='WindowC.htm'">同じサーバーのファイル
<BR><INPUT TYPE="button" VALUE="WindowB.location.href='WindowB.htm'"
            onClick="WindowB.location.href='WindowB.htm'">同じサーバーのファイル
</FORM>


参照 : 

http://home.netscape.com/eng/mozilla/3.0/handbook/javascript/advtopic.htm

Enabling tainting

To enable data tainting, the end user sets the NS_ENABLE_TAINT environment
variable as follows:

On Unix, use the setenv command in csh. 
On Windows, use set in autoexec.bat or NT user settings. 
On Macintosh, edit the resource with type "Envi" and number 128 in the
Netscape application by removing the two ascii slashes "//" before the
NS_ENABLE_TAINT text at the end of the resource. 

NS_ENABLE_TAINT can have any value; "1" will do.

If the end user does not enable tainting and a script attempts to access properties of a window on another server, a message is displayed indicating that access is not allowed.

To determine whether tainting is enabled, use the taintEnabled method. The following code executes function1 if data tainting is enabled; otherwise it executes function2.

if (navigator.taintEnabled()) {
   function1()
}
else function2()

For details on taintEnabled, see "taintEnabled".

Maintained by
tato@fureai.or.jp works1997takahashi factory