JSはいくつかのURLアドレスを取得する方法でまとめられています。

594 ワード

以下、JSがいくつかのURLアドレスを取得する方法

thisURL = document.URL;
thisHREF = document.location.href;
thisSLoc = self.location.href;
thisDLoc = document.location;

thisTLoc = top.location.href;
thisPLoc = parent.document.location;
thisTHost = top.location.hostname;
thisHost = location.hostname;

tmpHPage = thisHREF.split( "/" );
thisHPage = tmpHPage[ tmpHPage.length-1 ];
tmpUPage = thisURL.split( "/" );
thisUPage = tmpUPage[ tmpUPage.length-1 ];

は、以下、JSを使用してMACアドレス、IPアドレス、ホスト名を取得する方法である。