简体   繁体   English

通过Javascript嵌入请求未显示在IE9和IE10中

[英]Embeds Request Via Javascript Not Showing in IE9 & IE10

I have a site that has a series of embeds that users can use to insert the content they create on the site into their own blogs, pages, whatever. 我有一个网站,网站上有一系列嵌入内容,用户可以使用这些嵌入内容将在网站上创建的内容插入自己的博客,页面等。

The code we have them use is 我们让他们使用的代码是

<script src="[EMBED PROXY URL]" type="text/javascript"></script>

That code makes a call to the server and it returns something like 该代码调用服务器,并返回类似

(function(){  
  document.write("<iframe src='[EMBED VIEW URL]' frameborder='0' id='item_id_width' name='item_id_width' scrolling='no' marginheight='5px' height='400' width='200'></iframe>")
})();

I can see my server getting the request made by the javascript code, but for some reason in Internet Explorer 9 & 10, the server returns a HTTP 406 error ("Not accetable"). 我可以看到我的服务器收到了JavaScript代码发出的请求,但是由于Internet Explorer 9和10中的某种原因,服务器返回了HTTP 406错误(“不可加速”)。

It does not return the 406 error in Chrome, Firefox, or Safari. 它不会在Chrome,Firefox或Safari中返回406错误。 Everything loads as expected in those browsers. 一切都会在这些浏览器中按预期加载。

I have scoured the internet and can't find anyone who's run into this. 我搜寻了互联网,找不到遇到此问题的任何人。 So if anyone has any suggestions on how I fix this, I would appreciate it. 因此,如果有人对如何解决此问题有任何建议,我将不胜感激。

You're very likely hitting an instance of this: 您很可能会遇到以下情况:

http://blogs.msdn.com/b/ieinternals/archive/2011/03/27/http-406-not-acceptable-php-ie9-standards-mode-accepts-only-text_2f00_css-for-stylesheets.aspx http://blogs.msdn.com/b/ieinternals/archive/2011/03/27/http-406-not-acceptable-php-ie9-standards-mode-accepts-only-text_2f00_css-for-stylesheets.aspx

Look at the outbound Accept header in Fiddler or a similar debugger. 查看Fiddler或类似调试器中的出站Accept标头。 Is it different when coming from IE than when coming from other browsers? 来自IE时与来自其他浏览器时是否不同?

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

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