[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Using command line mocha:
I discovered (perhaps everyone knows this already)
that if you load a page that has some function blarg(), and
then select "open url" and type "mocha:blarg()" without the quotes
it will attempt to perform that function. I knew already that mocha:
would work with a command line style , but I did not know that
this could call functions that weren't built in....
This would be excellent for people scripting netscape with say
applescript, because you could then use the mocha: to tell this
JavaScript to do
things (which might involve openig a help app, etc.) and all you have to do
is tell netscape to open a new url with mocha:foo();bar(); etc.
for a concrete example, load my page at
http://www.c2.org/~andreww/javascript/
and then open a url an type mocha:goback()
and it will go back to the previous page.
Hmmmmm.
-------------------------------------------
Andrew Wooldridge (andreww@c2.org) |
http://www.best.com/~wooldri/ |
http://www.c2.org/~andreww/javascript/ |
-------------------------------------------