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?

link|improve this question

65% accept rate
At least in windows, the problem is made more complicated by the fact that both the 'run' command and shortcuts limit the number of characters allowed to less than the code you want to run takes. – Emil Jun 27 '10 at 13:27
As the answer hasn't been accepted yet, did my solution work? – Tom Wijsman Jul 16 '10 at 0:39
It didn't work. – Phenom Jul 16 '10 at 13:18
It works for me, either the mistake is with encapsulation or you're trying to do too much. Which brings me to the question: What are you trying to do? – Tom Wijsman Aug 10 '10 at 15:20
If it works for you then you should know what it does. – Phenom Aug 10 '10 at 18:43
feedback

1 Answer

Encapsulating it with double quotes works for me:

firefox "javascript:alert('Hello World')"
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.