IE9: Weird Javascript error

风流意气都作罢 提交于 2019-12-19 04:54:06

问题


I am getting an error while trying to display Google DFP ad banners in my website. The ads are showing in all browsers except IE9. You can view a simple test page with the banner here: (demo taken offline). The error is "Exception thrown and not caught" (google_ads.js, line 34 char 474).

I can view the ad in IE9 if I switch to IE7/8 compatibility view, so the problem appears to be with IE9. I am not sure if this is restricted to my computer, or if this is a universal problem. If it's the latter, this is a very serious concern for anybody running Google ads!

Your ads might not be showing on any of the newer computers with IE9 installed!

Can somebody please have a look, and confirm if this is a Google issue, or an issue with the my code?

Wild Thing


回答1:


I couldn't really find a permanent solution, but if anybody runs across this problem, you can just add

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" /> 

in your header to force your browser to emulate the IE8 document mode. This seems to fix the JS errors as well.



来源:https://stackoverflow.com/questions/4251625/ie9-weird-javascript-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!