Firefox 无法处理页面链接中的 %2b
我注意到以下 HTML 存在一个问题:
<html>
<head>
<title>UrlEncode Test</title>
</head>
<body>
<a href="http://example.com/Process.php?OrderID=y%2bog%3d">Process</a>
</body>
</html>
Firefox 不是用 + 替换 %2b,而是用空格代替,这样单击链接就会尝试导航到“ http://example.com/Process.php?OrderID=y og="而不是“http://example.com/Process.php?OrderID=y+ og=”。 IE 和 Chrome 完全没有问题;只是火狐。还有其他人遇到过这个问题并且能够解决它吗?
I noticed an issue where with the following HTML:
<html>
<head>
<title>UrlEncode Test</title>
</head>
<body>
<a href="http://example.com/Process.php?OrderID=y%2bog%3d">Process</a>
</body>
</html>
Instead of replacing %2b with +, Firefox does so with a space instead so that clicking on the link tries to navigate to "http://example.com/Process.php?OrderID=y og=" instead of "http://example.com/Process.php?OrderID=y+og=". IE and Chrome has no problems with this at all; just Firefox. Has anybody else encountered this and was able to workaround it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您遇到了 URL 编码问题。
对于你的情况,我建议像这样形成 url:
因为看起来您似乎打算以这种方式实际使用“+”符号。网址中包含“+”符号没有问题。
You're running into an issue with URL Encoding.
In your case, I would suggest forming the url like this:
Since it seems as if you intend to actually use the "+" symbol in that fashion. There's no problem with having a "+" symbol in your url.
所以我将您提供的代码保存在本地 HTML 文件中,在 Firefox 3.5 (Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5) 中打开它,将鼠标悬停在链接上(在状态栏中看到“y+og”),单击它,地址栏包含
http://example.com/Process.php?OrderID=y%2bog%3d
。你能用你的例子真正重现这个问题吗?什么操作系统上有什么版本的 Firefox?重现的具体步骤?So I saved the code you offered in a local HTML file, opened it in Firefox 3.5 (Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5), hovered the link (saw "y+og" in the status bar), clicked it and the location bar contained
http://example.com/Process.php?OrderID=y%2bog%3d
. Can you actually reproduce the problem with your example? What Firefox version on what OS? Exact steps to reproduce?最好使用“+”而不是%2b。但这里的跟踪将在 %2b 上完成。因为很少有浏览器会将此字符转换为编码,而 Leeds 会转换为 %2b。请关注此类。
它还取决于您使用哪种邮件软件。
补救措施是通过在其中使用“+”来创建链接。
尼森·乌尔斯/
质量保证部门 - 电子邮件营销。
Its better to use "+" in stead of %2b. But here tracking will be done on %2b. Since few browser will convert this character in to encoding and Leeds to %2b. Please be having track with this kind.
And also its depend on which kind of mailing software you are using at.
Remedy is to create the link by is using "+" in it.
Nithan urs /
QA Department - Email Marketing.