Is it possible to call a javascript function from the URL? I am basically trying to leverage JS methods in a page I don't have access to the source.
Something like: http://www.example.com/mypage.aspx?javascript:printHelloWorld()
I know if you put javascript:alert("Hello World");
into the address bar it will work.
I suspect the answer to this is no but, just wondered if there was a way to do it.
http:
at the start of the URI tells the browser "I want you to make an HTTP request", so HTTP request it does. There is no way around it, I think.javascript:alert("Hi");
into my Firefox (28.0) address bar and press Enter, nothing happens. Maybe this has been disabled? ... Yes, apparently it has been disabled because idiots could be convinced to paste anything into their address bar. Found the info here: stackoverflow.com/a/18782801/111036