如何在 Actionscript 2.0 中通过 getURL 函数使用问号?
Actionsctipt 代码:
on(press)
{
getURL(escape("address.html?0"));
}
这在 Internet Explorer 中工作得很好,但在 Chrome 中,问号显然变成了“%3F”。
有什么想法可以阻止这种情况发生并仍然保持与 IE 和其他流行浏览器兼容吗?
谢谢。
Actionsctipt code:
on(press)
{
getURL(escape("address.html?0"));
}
This works absolutely fine in Internet Explorer but in Chrome in the question mark is obviously made into "%3F".
Any ideas how I can stop this from happening and still keep it compatible with IE and other popular browsers?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
正如 mgraph 在他的评论中所说,你不应该转义整个 URL,只需这样做:
如果你的真实 URL(猜测“address.html?0”是一个简化的示例)有需要转义的部分,那么你会想要仅转义这些部分,以避免出现 ?和类似的逃脱。例如这样:
As mgraph says in his comment, you shouldn't escape the entire URL, simply do:
If your real URL (guessing "address.html?0" is a simplified example) has parts that needs to be escaped, then you would want to escape those parts only, to avoid having the ? and similar being escaped. So for example like this:
您可以尝试我在 this 中使用的 Adobe 提供的
Querystring
类回答。You could try the
Querystring
class provided by Adobe I used in this answer.