欧美一级精品免费播放-亚洲精品久久久久久人妖-中文字幕一区二区精品在线-国产精品亚洲一区二区在 色天天综合色天天久久婷婷_日韩綜合网_精品国产香蕉伊思人在线_99视频国产在线观看播放

注冊|登錄

聯(lián)系電話:024-31891684  13390130939
日志

沈陽軟件開發(fā)_沈陽軟件公司_沈陽軟件定制/軟件/日志

Log日志

js獲取當(dāng)前Url網(wǎng)址路徑及參數(shù)

瀏覽量:2093

http://localhost:81/Test/1.htm?Did=123
<br>以下為輸出:
<br>
<SCRIPT>
//獲取Url傳過來的值
function Request(name)
{
     new RegExp("(^|&)"+name+"=([^&]*)").exec(window.location.search.substr(1));
     return RegExp.$2
}

thisURL = document.URL;     // http://localhost:81/Test/1.htm?Did=123
thisHREF = document.location.href; // http://localhost:81/Test/1.htm?Did=123
thisSLoc = self.location.href;   // http://localhost:81/Test/1.htm?Did=123
thisDLoc = document.location;   // http://localhost:81/Test/1.htm?Did=123

thisTLoc = top.location.href;   // http://localhost:81/Test/1.htm?Did=123
thisPLoc = parent.document.location;// http://localhost:81/Test/1.htm?Did=123
thisTHost = top.location.hostname; // localhost
thisHost = location.hostname;   // localhost

thisU1 = window.location.protocol; // http:
thisU2 = window.location.host;   // localhost:81
thisU3 = window.location.pathname; // /Test/1.htm

document.writeln( thisURL + "<br />"); 
document.writeln( thisHREF + "<br />"); 
document.writeln( thisSLoc + "<br />"); 
document.writeln( thisDLoc + "<br />");

document.writeln( thisTLoc + "<br />"); 
document.writeln( thisPLoc + "<br />"); 
document.writeln( thisTHost + "<br />"); 
document.writeln( thisHost + "<br />");

document.writeln( thisU1 + "<br />"); 
document.writeln( thisU2 + "<br />"); 
document.writeln( thisU3 + "<br />");

document.writeln( "Did="+Request("Did") );// Did=123 
</SCRIPT>

 

沈陽團(tuán)購網(wǎng)|營口網(wǎng)站制作|沈陽軟件公司|軟件定制|網(wǎng)站建設(shè)|加盟易勢|提交問題