CSS3Pie causing startup error

半腔热情 提交于 2020-01-03 12:32:14

问题


When importing CSS3Pie, I'm getting the following error.

Uncaught TypeError: Object [object DOMWindow] has no method 'attachEvent'

I am using Chrome. Is this possibly something I have caused, or just a bug. Thanks!


回答1:


I think you should be importing the "PIE.js" file in an IE-only conditional comment:

<!--[if IE]>
  <script src='PIE.js'></script>
<![endif]-->

The CSS3Pie project is an Internet Explorer facility - it only works on IE, and is completely useless for all other browsers.

edit — note that this is if you're importing the stuff as a .js file in the first place. As far as I can tell, the CSS3Pie docs all encourage the functionality to be imported via the IE "behavior" CSS attribute. That attribute will just be ignored by Chrome and Firefox and Safari and everything else that's not IE.



来源:https://stackoverflow.com/questions/4422915/css3pie-causing-startup-error

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