Hacker News new | past | comments | ask | show | jobs | submit login

Is there a suite of unit tests to verify all of the code listed and that it works in all browsers or is the content opened sourced anywhere? For example if you look at "Empty an elements content" (http://plainjs.com/javascript/manipulation/empty-an-elements...) it shows this code:

var el = document.querySelector('div');

el.innerHTML = '';

Which is fine for a div but won't work in IE for a select (https://support.microsoft.com/en-us/kb/276228?wa=wsignin1.0).

Granted that's a weird bug but I'd expect any issues with examples could be logged, updated and tested against a browser suite to ensure correctness.




Thanks for your hint! It would be interesting to know which IE versions are affected.

Code on plainJS has no unit tests (so far) and it's objective is a) recommending useful and field tested vanilla JS plugins and b) provide useful code snippets for writing simple JavaScript driven sites without the help of jQuery.

The snippets are tested in all major browsers, but sure, at the current stage - there are rather likely some minor bugs here and there. Yet, I think it's pretty helpful to see the principle of how things are done without jQuery. So, even if there is a bug somewhere, the snippet still points into the right direction.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: