Closed hendrathings closed 8 years ago
I am getting this error message as well in Chrome. in Firefox, I get the following message:
TypeError: document.attachEvent is not a function ...n!1}},(!flexibility.detect()||t()<=9)&&document.attachEvent("onreadystatechange"...
This is an IE-only function it seems: https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/attachEvent
@mastastealth have you try it in ie? version 8 - edge? is it work for you?
There's no need to load this file in non-IE browsers
The issue is in this line here https://github.com/10up/flexibility/blob/master/lib/detect.js#L21 because ieVersion()
returns false
in non-IE browsers, and false <= 9
evaluates to true
@wyattdanger It'd be helpful to have this noted very strongly in the readme.
The fix is good to have :+1:
It would be nice to have a conditional comment version in the readme. It's a bandwith/connection saver.
<!--[if lte IE 9]>
<script src="flexibility.js"></script>
<![endif]-->
The conditional comment needs to be
<!--[if lt IE 10]>
<script src="flexibility.js"></script>
<![endif]-->
Flexbox doesn't work in IE9 so it needs to be loaded there as well. Or it could even just be this since conditional comments don't work in IE 10
<!--[if IE]>
<script src="flexibility.js"></script>
<![endif]-->
@Dan503 The original conditional works as well. if lte IE 9
means "less than or EQUAL to IE9" which is the same as if lt IE 10
Oh I didn't spot the "e". Ok yeah, yours works as well and is probably the better one to go with.
There are no events firing in v2, so this should no longer be an issue.
I use this plugin and get this error
Uncaught TypeError: document.attachEvent is not a function
in chrome and edge browser. Does any plugin missing here?