Comments (11)
What you had hold of initially was an ActiveX exception (the number is an HRESULT). Clearly IE 11 is no longer using ActiveX objects behind the scenes.
Might as well remove the check as it simply causes all other exceptions to fail silently. There's really no way to deal with the exception anyway. What's the point of having it enumerable in some browsers and not in others?
Realize this will never be a perfect imitation of classList
. It's simply an impossible task; for one, the array-like object returned is not live. Then there's the unsolvable IE 8- issue at hand.
A "polyfill" that doesn't actually work as expected only serves to deceive other scripts. It fools their feature detection into thinking that the feature is there, but it's really just an incomplete imposter.
In general, DOM "polyfills" are highly ill-advised and this one is a good example of why. Better to write wrappers (e.g. hasClass
, addClass
, etc.)
Also note that transpiling is just a red herring here.
HTH
from classlist.js.
I'm super busy with my proprietary stuff and missed this a year ago. I merged #43 just now.
I'm sorry about this issue affecting any of you. Please tell me if the changes I have merged have fixed this issue for you.
from classlist.js.
Hmm, odd. I will need to investigate further before removing the condition, but thanks for informing me. Years ago when I first made classList.js, that condition was working fine in IE8. Maybe a security patch changed something.
from classlist.js.
Agreed, having a condition there is probably a good idea. There may be some other kind of duck typing you can check on the error.
from classlist.js.
I can also confirm this issue. ex.number
results to undefined
in IE11's compatibility mode for IE8.
Removing the condition seems to solve it.
from classlist.js.
👍 Tested in IE8 with XP VM and this is still a problem. The solution proposed works great.
IE v8.0.6001.18702
Update Versions: 0
from classlist.js.
How can you replicate the problem? I have the same IE8 version in a Windows XP VM and I don't have this issue.
from classlist.js.
Windows XP VM from Microsoft running in VirtualBox on a host Macbook.
I use it via require/import it in a browserify/webpack bundle with babel transpiling
from classlist.js.
I'm running my Windows XP VM (32 bits) in a Virtual Box hosted on a Windows 7 VM (64 bits).
First time I hear about transpiling. I simply load classList.js in my <head>
and it has been working well so far.
from classlist.js.
@eligrey Could you please update the classList.js on the CloudFlare CDN and post the updated URL's in the readme.md?
from classlist.js.
I use this commit beck@d94a623 but it seems ie11 wont support multiple args. So I have to write:
e.classList.add(a);
e.classList.add(b);
from classlist.js.
Related Issues (20)
- ReferenceError: self is not defined HOT 1
- DOMException is undefined in IE8 HOT 3
- Object.defineProperty not working with older Safari Versions
- IE11/10 multiple argument remove and add not working due to SVG test HOT 16
- testElement.classList.toggle is not a function HOT 1
- tag the repo? HOT 4
- Maintenance Woes HOT 11
- Roadmap HOT 6
- No default export
- classList.js does not work if loaded after DOMContentLoaded HOT 1
- replace method is missing
- add() function with no arguments HOT 3
- The contains method have inverted condition HOT 2
- SCRIPT5009: 'DOMTokenList' is undefined HOT 7
- CDN link not working HOT 4
- ClassList not working in SVG use tag in IE11 HOT 4
- Not able to install via npm HOT 7
- Licensing HOT 3
- toggle fails in IE11 when force argument is set as undefined
- The specification of `DOMTokenList.prototype.contains` should return a boolean
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 classlist.js.