Removing leading whitespace in ES6 template strings

Note: this post remains for posterity but rather than using the template tags described here I'd suggest taking a look at common-tags. In some recent code at work we're using fairly large strings for error descriptions. JavaScript has always made it hard to deal with long…

Back to the future: ES6 + React

I've just recently finished shaving about a billion yaks * to convert a React app over to use ES6 modules and classes so we can start living in the future that is ES6 with a sprinkling of ES7. * Might not be true Transpiling back to the present We'…

JS: Creating instances without new

During a code review recently I was looking at some code that was using the new keyword to create an instance e.g: var inst = new MyConstructor(); The context object when new isn't used The code contained a safeguard to bail if the new keyword wasn't…

Does setTimeout solve the DOMContentLoaded problem?

I've recently been building a simple framework for testing the performance of arbitrary JavaScript code. Whilst doing so I was looking at the some information on setTimeout in "JavaScript the Definitive Guide" by David Flanagan [http://tinyurl.com/2634ue]. One paragraph made me think of the…

Basic DOMTool Tutorial

I've had some brilliant feedback on DOMTool [https://muffinresearch.co.uk/domtool/] and several people have emailed me asking for a basic tutorial on how to use the output. So if you're familiar with using the DOM to add content to a page then this probably…

DOMTool

I've had this idea kicking around for a while that it would be useful to build some kind of utility that took HTML as an input and output the correct DOM methods for inserting that content into a document. To start with I thought this would be some…

O2 thinks Camino is out of Date

[https://muffinresearch.co.uk/i/o2.jpg] I was amused to find when I visited the O2.co.uk website with camino [http://www.caminobrowser.org/], an alert box popped up saying "Your browser is out of date. Would you like to upgrade it now for a better user…