The 400 response in IE 11 is due to IE doesn't encode the url parameter correctly. In IE 11 the parameter sent is like below which is not right:
The encoded parameter which is right in Chrome should be like this:
I also find that if we check Send UTF-8 query strings
in Internet Options, the parameter will be encoded correctly and the example will work in IE 11:
So the issue is that param=??ü
is not encoded to UTF-8 in IE 11. I think it will be better if we encode all the urls for IE. Besides, <frameset>
is deprecated, you could use <iframe>
instead. The working sample code in IE 11 is like below:
<!DOCTYPE html>
<html>
<body>
<iframe src="https://www.stackoverflow.com?param=??ü"></iframe>
<script>
var mysrc = "https://www.stackoverflow.com?param=??ü";
document.getElementsByTagName("iframe")[0].src = encodeURI(mysrc);
</script>
</body>
</html>
Edit:
I also try to find some official docs about this, but there seems nothing. But I find some related threads:
encoding of query string parameters in IE10
Internet Explorer having problems with special chars in querystrings
If you refer to the threads, you'll find that EricLaw also says:
The behavior isn't fully documented anywhere.
We cannot reliably use URLs which are not properly encoded in Internet Explorer.
As we can't control if the users has checked the Send UTF-8 query strings
in IE and I refer to the threads above, I came up with the solution: The best approach is to encode all the urls in IE.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…