My Technical Notes

Friday, 20 September 2013

Making a simple Underscore js Bookmarklet for Firefox

I am liking the Underscore JS library because it is the same concept as LINQ and the other functional programming approaches to dealing with list transformations.

To make a simple bookmarklet you first create a new bookmark, and then set the Location to:


javascript:(function(){document.body.appendChild(document.createElement('script')).src='http://underscorejs.org/underscore-min.js';})();

This JS code creates a new script element on the page setting the src tag to the location of the Underscore library.

No comments: