<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( "DidDid="+Request("Did") );// Did=123
</SCRIPT>
分享到:
相关推荐
在开发javascript插件的过程中,我们有时候需要获取当前JS文件的路径,用于自动加载一些图片、CSS等外部资源,但是javascript文件中并没有像PHP那样的__FILE__常量来供我们取得当前文件路径
1、设计源码 代码如下: <...JavaScript获取路径</title> <meta http-equiv=”pragma” content=”no-cache”> <meta http-equiv=”cache-control” content=”no-cache”> <meta http
javascript获取浏览器临时目录javascript获取浏览器临时目录javascript获取浏览器临时目录javascript获取浏览器临时目录
nodejs fs 获得本地资源路径下面的所有文件,用递归的方式写的。主要是要用到 ftp ,由于需要上传 整个文件夹,就需要把所需要的文件夹下面文件一一获得。诶这东西太浪费时间了,分享只为求分!
js获取相对对路径js获取相对对路径js获取相对对路径
设置或获取对象指定的文件名或路径。 设置或获取整个 URL 为字符串。 设置或获取与 URL 关联的端口号码。 设置或获取 URL 的协议部分。 设置或获取 href 属性中在井号“#”后面的分段。 设置或获取 location 或...
通过js获取网址路径。等。。。。。。。。。。。。。。。。。。。。。。。。
如何在界面上打开文件夹并获取路径;web讨论网页资料
本文实例总结了JS获取文件大小方法。分享给大家供大家参考,具体如下: 方法一,利用ActiveX控件实现: [removed] function getFileSize(filePath) { var fso = new ActiveXObject("Scripting.FileSystemObject");...
NULL 博文链接:https://maidoudao.iteye.com/blog/1511757
使用JavaScript实现文件上传到本地服务器并获取到上传后文件所在路径,是由到...这个比较好,不是在jsp上获取路径,jsp太简单了,而且过时了,所以就在html页面实现了下功能,我主要是做出来插入到毕设项目中去。
方法一、js获取项目根路径的方法 function getRootPath(){ var curPageUrl = [removed].href; var rootPath = curPageUrl.split("//")[0] + curPageUrl.split("//")[1].split("/")[0] + curPageUrl.split("//")...
基于ArcgIs api for js 的路径分析例子,使用百度瓦片地图作为底图,将相关服务地址路径进行更换,即可。
基本概念的理解绝对路径:绝对路径就是你的主页上的文件或目录在硬盘上真正的路径,(URL和物理路径)例如:C:xyz est.txt 代表了test.txt文件的绝对路径。http://www.sun.com/index.htm也代表了一个URL绝对路径。相对...
最近在做项目的时候遇到一个问题,需要获取一个动态预览的图片的地址,这其实不是什么问题,主要是该图片的路径是写在css的background-img属性中的,于是决定要用js获取它的url中的内容,下面给大家分享解决的方法,...
解决由于IE安全性设置造成的不能正确读取文件路径的问题
[removed][removed] [removed][removed] account.jsp?name="+name+"&sex;="+sex; var name = $.query.get("name"); var sex = $.query.get("sex");
js获取真实路径 IE 火狐浏览器的真实路径地址。
【js获取桌面鼠标键盘事件怎么实现】 js获取电脑桌面路径.docx