URL拼接中文在IE浏览器下造成的 Error parsing HTTP request header The valid characters are defined in RFC 7230 and RFC 3986

1 var isDelay=$("#fieldCodeYes_IS_DELAY_BID").val();
2 $("#saveFrm").attr('action','/ebidding/bulletin/ChangeBulletin/submitModifyBulletin.htm?no_sitemesh'+
3  '&v(isDelay@String)='+isDelay);
4 $("#saveFrm").submit(); 

使用以上代码提交Submit时,后台报Error parsing HTTP request header错误(可能是其它问题,还要看详细错误)。

详细错误是The valid characters are defined in RFC 7230 and RFC 3986。只有IE浏览器会出现这个错误,其他浏览器内核正常运行。

意思就是无法转义某些中文符号

解决办法:encodeURI(转义中文字符)

var isDelay=$("#fieldCodeYes_IS_DELAY_BID").val();
$("#saveFrm").attr('action',encodeURI('/ebidding/bulletin/ChangeBulletin/submitModifyBulletin.htm?no_sitemesh'+
'&v(isDelay@String)='+isDelay));
$(
"#saveFrm").submit();

猜你喜欢

转载自www.cnblogs.com/zhanglixuan/p/10043422.html