Make custom.example.js run in IPython 2.x and 3.x

The last update of `custom.example.js` broke backward compatibility.

Is there a better way than to test for the IPython version ?