Internet Explorer 9 可以占用多长时间的 URL? [英] How long of a URL can Internet Explorer 9 take?

查看:14
本文介绍了Internet Explorer 9 可以占用多长时间的 URL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

过去版本的 Internet Explorer 会在超过 2,083 个字符的网址上发出嘶嘶声(请参阅 http://support.microsoft.com/kb/208427).同时,Firefox、Opera 和 Safari 至少可以处理 80,000 个.

Past versions of Internet Explorer croaked on web addresses longer than 2,083 characters (see http://support.microsoft.com/kb/208427). Meanwhile, Firefox, Opera, and Safari can handle at least 80,000.

第 9 版带来了许多改进.URL 长度是其中之一吗?

Version 9 brings many improvements. Is URL length is one of them?

推荐答案

这不是最准确的答案,但地址栏中看起来像是 2083 个字符,而点击链接时则是 5165 个字符.

Not the most precise answer, but it looks like 2083 characters in the address bar and 5165 characters when following a link.

(无论如何都不是官方的,只是将一个包含 41,000 个字符的 URL 插入到一个测试 HTM 文件中并使用 Javascript 来查询 URL 长度.)

(Not official in any way, just plugged a URL with 41,000 chars into a test HTM file and used Javascript to query the URL length.)

更新:

要重现测试,请创建一个 HTML 文件,其中包含一个锚元素,其 HREF 属性的长度为 6000 个字符.在浏览器中打开文件并单击链接.然后弹出打开控制台并检查 window.location.href.length.

To reproduce the test, create an HTML file with an anchor element whose HREF attribute is 6000 characters long. Open the file in your browser and click the link. Then pop open the console and check window.location.href.length.

今天在 IE9 中按照这个程序,它报告长度为 5165 个字符.如果我通过地址栏手动加载相同的 URL,它会报告 2083 个字符.

Following this procedure in IE9 today, it reports the length as 5165 characters. If I load the same URL manually through the address bar, it reports 2083 characters.

就其价值而言,IE 似乎在发送请求之前截断了 URL.如果我将 24,000 个字符的 URL 放在锚点的 HREF 属性中,IE 将跟随该链接,但结果页面报告的 URL 长度为 5165 个字符.在 Chrome 中访问相同的链接会导致来自我的测试服务器的 HTTP 414 响应.

For what it's worth, IE seems to truncate the URL before sending the request. If I put a URL of 24,000 characters in the anchor's HREF attribute, IE will follow the link but the resulting page reports a url length of 5165 characters. Following the same link in Chrome results in a HTTP 414 response from my test server.

这篇关于Internet Explorer 9 可以占用多长时间的 URL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆