JavaScript
This isn't going to be anything spectacular, but I do hope to give a basic rundown of the JavaScript language, and maybe post a few useful scripts. I'm pressed for time, so this page won't be much for a while. I am working on it, and hope to be done sometime this month. Before reading this, you should know the basics of HTML.
Basic JavaScript
Most people that use JavaScript on their pages don't actually know the language. They either copy scripts they've seen on other people's pages, or have a friend do it for them. What they don't realize is that JavaScript is actually a very simple language, and the basics of it can be learned quite quickly. Listed are some common things people do with JavaScript, and instructions on how you can use them.
Change the text in the status bar
Changing the text in a user's status bar is probably the most common use of JavaScript. This is actually quite simple. The following example may look confusing, but after looking it over carefully, it should look simpler.
a href="#" onMouseOver="window.status='Hello there'; return true"
Taking it apart
This is a basic link tag. It leads to a location called '#', and changes the text in the status bar to 'Hello there'. The actual JavaScript without the HTML part looks like this:
onMouseOver="window.status='Hello there'; return true"
The first part (onMouseOver) tells your browser to execute the code when the user moves their mouse over the link. The second part (window.status='Hello there') tells the browser what to do when the user moves their mouse over the link. In this case, it's change the window's status bar (window.status) to 'Hello there'. The last part (; return true) does two things: the ; tells the browser that it has reached the end of one line of code, and the rest (return true) tells the function to return a true value. This is not necessary, but, for reasons unknown, Netscape requires this.
More coming later, so stay tuned!
Fun JavaScripts to Play With
Right now, all I have is a JavaScript game I wrote a while ago called JavaScript Slots. It's my version of a slot machine, written in JavaScript. It comes with no instructions, though it shouldn't be hard to figure out. I hope to have more stuff coming soon.
That's all I've had time for. Give me a few days, and there'll be more. Thanks for visiting!
This page is maintained by StevenS. If you have any questions or comments,
please e-mail me at [email protected].