js 获取当前页面路径
来源:互联网 发布:程序员看的书 编辑:程序博客网 时间:2024/06/11 00:34
设置或获取对象指定的“文件名”或路径。
<script>
alert(window.location.pathname)
</script>
设置或获取整个 URL 为字符串。
<script>
alert(window.location.href);
</script>
设置或获取与 URL 关联的端口号码。
<script>
alert(window.location.port)
</script>
设置或获取 URL 的协议部分。
<script>
alert(window.location.protocol)
</script>
设置或获取 href 属性中在井号“#”后面的分段。
<script>
alert(window.location.hash)
</script>
设置或获取 location 或 URL 的 hostname 和 port 号码。
<script>
alert(window.location.host)
</script>
设置或获取 href 属性中跟在问号后面的部分。
<script>
alert(window.location.search)
</script>
网页刷新推荐-JS
<input type=button value=刷新 onclick="history.go(0)">
<input type=button value=刷新 onclick="location.reload()">
<input type=button value=刷新 onclick="location=location">
<input type=button value=刷新 onclick="location.assign(location)">
<input type=button value=刷新 onclick="document.execCommand('Refresh')">
<input type=button value=刷新 onclick="window.navigate(location)">
<input type=button value=刷新 onclick="location.replace(location)">
<input type=button value=刷新 onclick="document.URL=location.href">
<input type=button value=刷新 onclick="location.reload()">
<input type=button value=刷新 onclick="location=location">
<input type=button value=刷新 onclick="location.assign(location)">
<input type=button value=刷新 onclick="document.execCommand('Refresh')">
<input type=button value=刷新 onclick="window.navigate(location)">
<input type=button value=刷新 onclick="location.replace(location)">
<input type=button value=刷新 onclick="document.URL=location.href">
阅读全文
1 0
- js获取当前页面路径
- js 获取当前页面路径
- js 获取当前页面路径
- js获取网页当前页面及路径
- js获取当前页面所在目录路径
- js、angularjs获取当前页面路径与页面名
- JS获取当前网址,JS获取当前域名URL ,JS获取网站完整路径页面地址
- js 获取当前页面路径 网页刷新推荐-JS
- js 获取当前路径
- js获取当前路径
- JS获取页面当前路径的相关信息
- asp获取当前页面路径
- 获取jap页面当前路径
- js 获取当前服务器路径
- JS: 获取当前页面URL
- JS: 获取当前页面URL
- JS获取当前页面名称
- js获取当前页面名称
- 面向对象(一)——类
- 各种编码UNICODE、UTF-8、ANSI、ASCII、GB2312、GBK详解
- Qt多线程实现opencv的人脸检测
- 同步信号PSS , SSS
- DockPanel
- js 获取当前页面路径
- Windows10 VS2013 C#配置EmguCV 3.2 (傻瓜式讲解)
- session学习杂记
- 目标跟踪相关资料
- java 包装器类型的实现
- 智慧警务指挥决策系统,助力平安城市
- Glide加载自签名认证的https图片
- 在linux环境下安装Mysql
- 选择相册上传图片 展示图片(仿微信选择图片)