So what's fragments.js? Is it yet another library? Is it a framework or perhaps a methodology? No, no and no, it is more like a philosophy. The main idea behind fragments.js is to use the tools at hand to their maximum. Libraries are good, and even necessary in some situations, but they also carry a cost. They need be activily maintained and upgrades sometime require you to change your code. You could perhaps call fragments.js design patterns but I prefer to see it more like a learning process.

The artilces below outlines solutions to common needs when developing web apps. The idea is that you copy the snippets you need. It does take a little more effort but it will be cheaper, and more fun, in the long run. And it will make you a better developer.This approach does use features in JavaScript that some old browser versions don't support. Check the compability section for each fragment.

Where is the download button? Well, there is none! Check out the solution for your need, view source and copy/paste.


A little insight into the different Browser engines and JavaScript versions makes it easier to determine which way to go. Use of libraries is often motivated by the need for support for old browser versions.


Comments and contributions are welcome! This site is hosted Github. Contribute by forking and creating a pull request. Create an issue if you have thoughs and/or comments.

Additional resources


fragments.js uses an ISC license, see license


You can reach me at: jonas[a]


This site currently has a very modest (almost zero) design. Hang in there, I currently prioritize content over design, perhaps I'll fix the design also sometime.