Asynchronous syntax

In a perfect world all the objects on a page would be always created by the time we needthem. However, frequently some scripts are loaded asynchronously or the javascriptcode is not well organized on the page. In that case it is unknown when the o...

Surveys using Google Spreadsheets as a database

Frequently we need to survey our visitors. We don’t bother developing our ownsurveying tool because there are already lots of them. Mostly payed but cheaperthan developing your own.Google Forms?On the other hand, there is Google Forms. Although Go...

Vanilla A/B testing with Abo

In a previous post I wrote about how unhandy it is to develop A/B tests in Optimizely’s web interface. In this post I want to get one step further. If we don’t develop our experiments in Optimizely, why do we need to copy paste the code to Optimiz...

How to dynamically create an IFrame

I’ve spent a lot of time on figuring out how to create an iframe dynamically. At first, I thought it is as simple as:var iframe = document.createElement('iframe');document.body.appendChild(iframe);iframe.contentWindow.document.write('<div>fo...

The art of writing minifiable JavaScript

There are situations when we want to have as small JavaScript files as possible. JavaScript compressors like UglifyJS can reduce the size of JavaScript source code multiple times. However, they can compress it a lot more effectively with some help...