简体   繁体   中英

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").

It does not return the 406 error in Chrome, Firefox, or Safari. 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

Look at the outbound Accept header in Fiddler or a similar debugger. Is it different when coming from IE than when coming from other browsers?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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