Comments (10)
while I think I might check the main file problem you mentioned, you really DON'T want to require ie8 - this is a template IE8 conditional comment only because not a single other browser should include this file at all, not even downloading its bytes.
This is the part you need to place in your main template file
<!--[if IE 8]><script src="ie8.js"></script><![endif]-->
that's it
from ie8.
I'm building a SPA, so all my code is only ever downloaded once so I'm willing to pay the byte price.
If I wanted to keep all my IE polyfills in a separate file, it seems like Browserify would be a useful way to bundle them before delivery.
from ie8.
are you serving this file to every browser or you are using conditional comments?
This is the only way this file should be included:
<!--[if IE 8]><script src="ie8.js"></script><![endif]-->
Everything else is wrong … but .. if you are bundling all IE8 related scripts in one JS file and serving that at the top like this:
<!--[if IE 8]><script src="bundle.js"></script><![endif]-->
then you might be good to go with browserify … is this what you are trying to do?
from ie8.
.. try again, if you are sure what you are doing. 0.1.4
should give you the right file
from ie8.
Are you saying it's wrong because you think the transfer overhead is too much, or because the code itself isn't doing feature detection before executing the polyfill and therefore might interfere with non-IE8 browsers?
from ie8.
both … everything is wrong if you don't use conditional comments … there's no reason to even parse this file syntax in browsers that are not IE8
I've fixed the require thing … but you should NOT use browserify for this … I don't know why you want to do that
from ie8.
once again: https://github.com/WebReflection/ie8#how-to-include-the-project
from ie8.
also, the file starts with if (document.createEvent) return;
which AFAIK is not available in IE8 and avoids double patching in IE8 … the reason there is a conditional comment for IE8 only is that:
- this polyfill is for IE8 only, everything else that does not support
document.createEvent
will break - there is nothing wrong in using conditional comments, these are simply comments for every other browser but IE < 11 and IE will ignore if not exact match with version 8 as specified before
- why do you want to include this for every browser is a mystery to me … if it's about bundling inline you can still use the conditional comment and put the content in the script instead of using external src
- are you sure with this script IE8 will work ? there's more to add to an env to have IE8 working, like dom4 and / or others shims and polyfills, this is the top of the iceberg for IE8 support but the only one you want to put a part in a conditional comment
That being said, bug fixed as suggested, thanks.
from ie8.
All I want is to be able to use event.currentTarget without worrying that it will break IE8.
I'd rather transfer a polyfill that doesn't get executed than complicate my build process by adding another file to my webroot or add lines to my index.html. That's just where my priorities are, $ npm install ie8 --save-dev; require(); and get on with my job.
But maybe what I'm looking for is a smaller module that doesn't do quite as much. Thanks for the warning, and for addressing the issue so fast!
from ie8.
to my knowledge, the only browser that could break without conditional comments is IE7 and IE6 but I don't exclude some extra jurassic browser that will miserably fail too.
That being said, if you need "just e.currentTarget
" you need an entirely patched event system, which is what this polyfill provides.
AFAIK there's nothing as standard and as tested as this one out there, I would not have spent time creating this in first place.
Last, but not least, your build system should be helping you making just a move file right away, and writing something you'll never have to change in the future in a single template wrapper with generic headers shouldn't be too hard job ;-)
Happy to help, I was just also proposing best practices since I've explained how to include and I was not expecting anyone to bring this in via browserify … too late since the npm
package was there and it was actually not working as expected.
Best Regards
from ie8.
Related Issues (20)
- IE9 doesn't like the Comment and Text nodeValue shims
- 'defineProperty' is null or not an object HOT 4
- CDN-Link retursn 404 HOT 2
- addEventListener polyfill is firing the actual event on the actual element the first time that event is listened to HOT 8
- browserifies require fails on ie8 HOT 10
- what's the problem? HOT 3
- Do you know how to use this polyfill with babel browser polyfill? HOT 2
- getElementsByClassName HOT 10
- HTMLSelectElement defineProperties throw error in IE8 HOT 3
- Cannot attach mousemove to document HOT 9
- Publish ie8.max.js HOT 4
- Conflicts with React 0.14 HOT 12
- some new ie8 Compatibility HOT 3
- IE8 don't support pageX/Y on Event properties
- IE8 supports different button value on Event HOT 2
- Add changelog? HOT 1
- real ie8 StackOverflow exception HOT 1
- Some fixes of event and window attributes HOT 1
- document.createEvent('HTMLEvents') fails HOT 1
- Add Event#defaultPrevented support HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ie8.