国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 語(yǔ)言 > JavaScript > 正文

js獲取當(dāng)前路徑的簡(jiǎn)單示例代碼

2024-05-06 15:59:04
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友
本篇文章主要是對(duì)js獲取當(dāng)前路徑的示例代碼進(jìn)行了介紹,需要的朋友可以過(guò)來(lái)參考下,希望對(duì)大家有所幫助

<script type="text/javascript">   
thisURL = document.URL;
thisHREF = document.location.href;
thisSLoc = self.location.href;
thisDLoc = document.location;
strwrite = " thisURL: [" + thisURL + "]<br />"
strwrite += " thisHREF: [" + thisHREF + "]<br />"
strwrite += " thisSLoc: [" + thisSLoc + "]<br />"
strwrite += " thisDLoc: [" + thisDLoc + "]<br />"
document.write( strwrite );

thisTLoc = top.location.href;
thisPLoc = parent.document.location;
thisTHost = top.location.hostname;
thisHost = location.hostname;
strwrite = " thisTLoc: [" + thisTLoc + "]<br />"
strwrite += " thisPLoc: [" + thisPLoc + "]<br />"
strwrite += " thisTHost: [" + thisTHost + "]<br />"
strwrite += " thisHost: [" + thisHost + "]<br />"
document.write( strwrite );

tmpHPage = thisHREF.split( "http://www.survivalescaperooms.com/" );
thisHPage = tmpHPage[ tmpHPage.length-1 ];
tmpUPage = thisURL.split( "http://www.survivalescaperooms.com/" );
thisUPage = tmpUPage[ tmpUPage.length-1 ];
strwrite = " thisHPage: [" + thisHPage + "]<br />"
strwrite += " thisUPage: [" + thisUPage + "]<br />"
document.write( strwrite );
var url="<%=request.getRequestURI()%>";
alert(url)
</script>

request.getRequestURI();
request.getRequestURL();
request.getQueryString();

request.getServletPath()

可以得到自己的網(wǎng)絡(luò)地址:request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getRequestURI()

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表

圖片精選

主站蜘蛛池模板: 富锦市| 寿阳县| 朝阳县| 津市市| 安阳市| 徐闻县| 山东省| 乐亭县| 门源| 红原县| 彭水| 临江市| 广州市| 永平县| 侯马市| 朝阳市| 云霄县| 招远市| 山东| 景泰县| 金湖县| 新巴尔虎右旗| 辽源市| 兴业县| 静安区| 拉孜县| 斗六市| 韶关市| 洪江市| 芒康县| 萨嘎县| 新津县| 大竹县| 洛隆县| 遂平县| 公主岭市| 信丰县| 清苑县| 涪陵区| 晋城| 安乡县|