kw
03-26-2003, 09:42 AM
Hello ppl,
this is a thread about something quite simple I've been using for quite a long time now, and I thought people might find interesting. I see some people bash Javascript because they're using it for the wrong reasons, and it doesn't work well in those occasions.. Of course it won't, it wasn't designed to be like flash or Java, or whatever.
What it IS useful for is for quick little tasks concerning webpages. Ive been using little html files containing scripts for quite a while, to make browsing a bit easier.. For example, when I type 'dict' in my address bar, the bookmark I have named 'dict' is started, which is dict.html, containing:
<script>window.location="http://dictionary.reference.com/search?q="+window.prompt('Word:');</script>
This will give me a quick prompt for a word, and then bring me to the appropriate dictionary page (making use of passing the variables in the address :))
There are a lot of these little applications where small scripts are really quite useful ;)
One more before I go is get.html, to get a file you have the address for but the browser wont let you simple save (but tries to run, for example.. Say a .class file ;))
<script>document.write('<a href="'+window.prompt("URL:")+'">Here</a>');</script>
I didn't quite know what to do with this post, but I figured it'd fit neatly beside the commandline browsing thread ;)
Ciao,
-KW
this is a thread about something quite simple I've been using for quite a long time now, and I thought people might find interesting. I see some people bash Javascript because they're using it for the wrong reasons, and it doesn't work well in those occasions.. Of course it won't, it wasn't designed to be like flash or Java, or whatever.
What it IS useful for is for quick little tasks concerning webpages. Ive been using little html files containing scripts for quite a while, to make browsing a bit easier.. For example, when I type 'dict' in my address bar, the bookmark I have named 'dict' is started, which is dict.html, containing:
<script>window.location="http://dictionary.reference.com/search?q="+window.prompt('Word:');</script>
This will give me a quick prompt for a word, and then bring me to the appropriate dictionary page (making use of passing the variables in the address :))
There are a lot of these little applications where small scripts are really quite useful ;)
One more before I go is get.html, to get a file you have the address for but the browser wont let you simple save (but tries to run, for example.. Say a .class file ;))
<script>document.write('<a href="'+window.prompt("URL:")+'">Here</a>');</script>
I didn't quite know what to do with this post, but I figured it'd fit neatly beside the commandline browsing thread ;)
Ciao,
-KW