Location.href 给出了部分网址
Location.href is giving partial url
在页面URL上,例如:
http:mysite.com/index.php?mact=News,cntnt01,detail,0&cntnt01articleid=3&cntnt01returnid=15
使用 location.href 将返回
http://mysite.com/index.php?mact=News,cntnt01,detail,0
有没有办法获取完整的URL,包括'...&cntnt01articleid=3&cntnt01returnid=15'
谢谢
亨利
如果您的 URL 格式正确,则查询字符串将在window.location.href
中可用。
http://en.wikipedia.org/wiki/Percent-encoding
逗号是 URI 中的保留字符,不应用作查询字符串值的一部分。此外,您应该对 URL 进行 URI 编码。这是在javascript中通过调用encodeURI来完成的。
相关: 我可以在 URL 中使用逗号吗?
相关文章:
- 我可以使用location.href为变量生成url吗
- 如何将所有作业自定义到window.location.href
- 如果window.location.href.indexOf('player=1')添加样式
- 设置location.href在<a>点击
- 可以'当window.location.href时,无法从javascript获取post值
- window.location.href/reload导致AngularJS[$rootScope:infdig]达到1
- 如何在同一页面上使用windows.location.href将js值传递给php时停止刷新页面
- 当用户在选择框中选择选项时,使用window.location.href重定向用户只会更改导航器中URL的最后一位
- 历史推送状态不在独立的 location.hash 或 location.href 中,而是在 Location 对象本
- window.location.href =“#find” 适用于移动设备,但不适用于 PC.在本地站点上正常(表达式
- Javascript-将变量传递给php页面,window.location.href不起作用
- 使用 Div 标签的 location.href 属性时,Eval 不起作用
- 使用 location.href 重定向
- 后退按钮在 window.location.replace(href);之后失败
- Location.href 叫了两次
- onbeforeunload导航使用location.href
- 如何在windows.location href中插入变量
- 使用self.location.href重定向不会'不起作用
- 在window.location.href中使用php
- 浏览器11上的Javascript location.href崩溃