How can I make Firefox load JavaScript from the command line?

At the command line I can load websites like this:

firefox.exe google.com

However, what I am trying to load is the following:

javascript:q=document.getSelection();d='U';c=document.characterSet;if(c=='Shift_JIS')d='S';if(c=='EUC-JP')d='D';if(!q){void(q=prompt('Enter%20text%20to%20search%20using%20WWWJDIC%20(Japanese).',''))};if(q)location.href='http://www.csse.monash.edu.au/~jwb/cgi-bin/wwwjdic.cgi?1M'+d+'J'+q

This will load if I paste it in the address bar of firefox, but it will not load if I specify it as an argument from the command line. How can I make it load from the command line?


Solution 1:

Encapsulating it with double quotes works for me:

firefox "javascript:alert('Hello World')"