简体   繁体   English

在IE6,IE7中解决了太久的查询字符串?

[英]Workaround for too long querystring in IE6, IE7?

I have a form which submits fine in FF, Opera, Safari, Chrome, and also IE8... But it wont submit in IE6, or IE7... 我有一个表格在FF,Opera,Safari,Chrome和IE8中提交...但它不会在IE6或IE7中提交......

I have noticed it is 99% sure that the problem is a too long querystring. 我注意到99%确定问题是一个太长的查询字符串。 I have many many options... 我有很多选择......

Now, changing the method to POST is out of the question here, so don't bother asking about this please... 现在,将方法更改为POST是不可能的,所以请不要再问这个问题了...

I wonder, is there any other workaround for this problem? 我想知道,这个问题还有其他解决办法吗? Also, why is only IE6 and IE7 having this problem? 另外,为什么IE6和IE7只有这个问题呢?

If there is no workaround, will "disabling" the "too many" inputs which are over the limit help shortening the querystring? 如果没有解决方法,那么“禁用”超出限制的“太多”输入会有助于缩短查询字符串吗? In other words, will disabled form elements also be added to the querystring? 换句话说,还会将禁用的表单元素添加到查询字符串中吗?

Thanks 谢谢

To answer your second question, Microsoft's got the answer here: http://support.microsoft.com/kb/208427 The maximum URL is 2,083 characters, so the page resulting from the GET request must have a URL shorter than that. 要回答第二个问题,Microsoft的答案如下: http//support.microsoft.com/kb/208427最大URL为2,083个字符,因此GET请求产生的页面必须有一个短于此的URL。

To answer your third question, w3.org/TR/html401/interact/forms.html#h-17.12 : "Disabled controls can not be successful", ie they will not submit. 要回答你的第三个问题, w3.org/TR/html401/interact/forms.html#h-17.12 :“禁用控件无法成功”,即他们不会提交。

To answer your first, perhaps you can put a character limit on some of the fields, like a textarea. 要回答你的问题,也许你可以对某些字段设置一个字符限制,比如textarea。 Another option might be to compress the input using javascript, hashing it somehow, and then unhashing it server-side on the submitted page. 另一种选择可能是使用javascript压缩输入,以某种方式对其进行散列,然后在提交的页面上对服务器端进行散乱。

If you're sure that that's the issue, and not the million other cross browser problems, you could try an ajax call. 如果您确定这是问题,而不是其他百万个跨浏览器问题,您可以尝试ajax调用。 Split up the query into 2, 3, n calls. 将查询分成2个,3个,n个调用。

Is it just a form? 它只是一种形式吗? May I ask why POST is out of the question? 我可以问为什么POST是不可能的?

Query string too long error can be avoided by a simple IIS settings change. 通过简单的IIS设置更改可以避免查询字符串太长的错误。 http://www.mytecbits.com/microsoft/iis/query-string-too-long http://www.mytecbits.com/microsoft/iis/query-string-too-long

它不是很好,但你可以将价值推入一个cookie

To answer your last question first Disabled form inputs are NOT GETted or POSTed back to the server 要回答您的上一个问题,首先禁用表单输入不会被 GET或发回服务器

If posting isn't an option, you can try eliminate non-essential form inputs, and although cheesy, reduce the length of the NAMEs of your elements will also shorten the Querystring. 如果发布不是一个选项,你可以尝试消除非必要的表单输入,虽然俗气,减少元素的NAME长度也会缩短Querystring。

You can also try to do some client side compression of the query string values in JavaScript. 您还可以尝试在JavaScript中对查询字符串值进行一些客户端压缩。

I have had some success using base 93 encryption to get a significant reduction in string size. 我使用base 93加密功能可以大大减少字符串大小。

You can also try huffman compression, although it is more processor heavy. 你也可以试一下huffman压缩,虽然它的处理器更重。

http://rumkin.com/tools/compression/compress_huff.php http://rumkin.com/tools/compression/compress_huff.php

If you are only expecting a limited character set (lowercase az) you could come up with a few other tricks. 如果你只想要一个有限的字符集(小写az)你可以想出一些其他的技巧。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM