Javascript Location.href正在提供部分url

Javascript Location.href正在提供部分url,javascript,Javascript,在页面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” 谢谢 Hen

在页面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”

谢谢


Henri

如果您的URL格式正确,则可以在
窗口.location.href
中使用查询字符串

逗号是URI中的保留字符,不应用作查询字符串值的一部分。此外,您还应该对url进行URI编码。这是在javascript中通过调用来完成的


相关:

如果您没有JavaScript,请立即获取一个,并尝试检查
window.location
(即
console.dir(window.location)
)请发布您的代码。无论您的URL是否有效,
location.href
都会为我返回全部内容。@jsalonen
如果您没有JavaScript
:奥雷利。我不知道我在写o的时候是怎么想的_O@RayURL在上面,代码是:function mailpage(){mail_str=“mailto:?subject=检查此链接-->“+document.title;mail_str+=”&body=“+document.title;mail_str+=”…在:“+window.location.search;location.href=mail_str;}显然(由我提供)window.location.href在“&”符号处停止。不幸的是,这个url是由CMS生成的,我无法更改它。@user1464314根据,
window.location.href
应该给出整个URI,包括querystring。