>> LOOK DOWN
See the message sliding across the gray bar at the very bottom of your browser window?
That's JavaScript. It's the status bar scroller, and the code for it is on the
Status Bar page. If you don't see it, you probably have
JavaScript turned off, or you're on something ancient. (Netscape 1? Really?)
>> WHO I AM
I'm Lorenzo, I'm 16, I live in New Mexico, and I've been messing with JavaScript since
last fall. I learned it by doing View Source on about a million pages and taking the
scripts apart to see how they worked, plus a book from the library that was so old it
still called Netscape 2 "the new browser." Half the scripts I found online
only worked in one browser, or crashed the other one with a big error box, so I started
fixing them and then writing my own. That's what this site is.
My setup: the family computer in the den, a Pentium 166 MMX with 32 megs, Windows 98,
and both Netscape Communicator 4.61 and Internet Explorer 5 installed, just for
testing. I also check things on Netscape 3 at school when I can get a computer in the lab,
because a lot of people out there still have it.
And yes, my address is 4004 on purpose. The Intel 4004 was the first microprocessor
ever, from 1971. I tried about twenty addresses in Monitor before I found one open that
meant something.
>> THE SCRIPTS
 |
STATUS BAR TRICKS
Messages when you point at a link, the scroller, and a typewriter that types itself out. |
 |
CLOCKS & DATES
A live ticking clock, today's date done right for Y2K, good morning/good evening, and a
countdown to the year 2000. |
 |
NO RIGHT CLICK
The most requested script on this site. Please read the whole page before you use it. |
 |
ROLLOVER BUTTONS (coming soon)
Buttons that light up when you point at them. I have it working in both browsers but my
button graphics look terrible. Working on it. |
>> HOW TO USE A SCRIPT (READ THIS IF YOU'RE NEW)
- Copy the whole thing, from <script> to </script>.
Missing one character is enough to break it.
- Paste it where the page says. Scripts that just set things up (the ones with
function in them) go in the <head>. Scripts that use
document.write go in the <body>, right where you want the words to
show up.
- Leave the <!-- and //--> lines in. They hide the script
from really old browsers that don't know JavaScript, which would otherwise print the whole
thing on your page as text.
- JavaScript is case sensitive. document.write works.
Document.Write doesn't. This is the number one thing people e-mail me about.
- If nothing happens, find the error. In Netscape, type javascript: in
the Location box and press Enter, and a window opens with the error and the line number.
In IE, look for a little yellow warning sign at the bottom left corner of the window and
double-click it.
- Test it in both browsers. I did, but your page isn't my page.
>> TWO QUICK ONES
A "go back" link that takes people to whatever page they came from:
|
<a href="javascript:history.back()">Go back</a>
|
And a line that says when you last changed the page, so you never have to type the
date again. Put it at the bottom of your page:
<script language="JavaScript">
<!--
document.write("Last updated: " + document.lastModified);
//-->
</script>
|
Netscape and IE write the date in different styles, but it works in both.
>> THE DEAL
- Every script here is free for your home page. That's why they're here.
- Leave my one-line comment at the top of the code. Your visitors can't see it anyway.
- Don't put my scripts on your own script page like you wrote them. Somebody already
did that and I found it in about two days.
- A link back to the Zone is cool but you don't have to.
- Found a bug? Tell me which browser and which version. I fix stuff fast.
>> JAVA IS NOT JAVASCRIPT
I have to say this because people keep asking me for "Java scripts." Java is a whole
different language. Java applets are those gray boxes that take forever to load and say
"Starting Java..." at the bottom. JavaScript is little scripts that go right inside
your HTML. The names are almost the same. That's it. That's all they have in common.