To see if your code works, I added an
alert("bookmarklet loaded"); at the end of the bookmarklet. So you can try and should - since I tested on Firefox 17- see as a result a messagebox appears. If your code works or does not work I am unable to say, but of course this was not the question.
<script></script> tags easier to be adopted for a bookmarklet
An example here
Let's have an example. Let's have two sourcecode snippets with two instructions:
When put all in one line (= make the linebreak to whitespaces) you would first end up with this:
var anumber=1 var atext="hallo"
var anumber=1; var atext="hallo"
- Wrap all you code in kind of this kind of closure:
There are quite some websites out there to investigate the solution. Like here.