Copy and Paste codes

Unlike HTML, Java Script is really a little too involved to memorize, although it is easy enough to copy and paste the codes, and then customize them, to some degree, to your liking. I've learned from talking to other people on the net, however, that it is possible to actually learn how Java Script works, and invent your own codes. Maybe someday I will be that smart....in the mean time I will just copy and paste....copy and paste...OH! Sorry! Anyway, if you see something you like on someone's page and you want to know how they accomplished it, right click on the page you are viewing and select "View Source" from the menu that pops up. A separate window will pop up with a text version of the page. Now you can see what codes that person used. In the meantime, check out these codes I found during my own explorations:

Personalized Greeting
Scrolling Border text
OnLoad Pop up Message
Image Captions
MouseOver Pop ups
Time and Date Stamp

The Java Name Prompt: Personalizing your greeting

This code should be placed just below the BODY tag. It causes a pop up box to appear, prompting your visitor to enter their name. Once they submit it, the page will finish loading and they will see a mesage personally welcoming them to your page, using their name.

<P>
Hi <SCRIPT LANGUAGE=JavaScript>
document.write(window.prompt("Please enter your first name or a nickname",""))
</SCRIPT>! Thanks for stopping by!
<P>

Back to top

Scrolling Text in the bottom Browser Border

This code needs to be placed on the last part of your page; BELOW the </BODY> tag and BEFORE the </HTML> tag. It will cause a scrolling mesage to appear in the bottom border of your visitors browser. copy and paste the code, and replace where it says type the text you want scrolling in the border here with whatever message you want people to see:

<SCRIPT LANGUAGE=JavaScript>
var scrollCounter = 0;
var scrollText      = "type the text you want scrolling in the border here"
var scrollDelay    = 70;
var i = 0;
while (i ++ < 140)
scrollText = " " + scrollText;
function Scroller()
{
window.status = scrollText.substring(scrollCounter++,
scrollText.length);
if (scrollCounter == scrollText.length)
scrollCounter = 0;
setTimeout("Scroller()", scrollDelay);
}
Scroller();
</SCRIPT>

Back to top

On Load Pop Up Messages

You can make an "Alert" pop up as your page is loading with a simple code. It's a sure fire way to get peoples attention. It could be anything from a simple message, such as "Thanks for visiting my page" to a reminder, such as, "be sure to refresh your browser for the most current version of my page". Here's the code:

Place this code just below the </HEAD> tag on your page:

<BODY onLoad="alert('Type the message you want popped up here')">

Back to top

Mouse Over Image Captions

In many cases, when your mouse pointer rests on an item a small box will pop up with a cute little remark about that item. Adding an extra something to your IMG SRC code will make that happen to your items, too.

Rest your pointer over this pitcure: Hi, I'm Celes. Nice to meet you!

Note: People will also see that message in the pitcures spot until the pitcure fully loads.

It's very simple to do. Instead of typing just:

<IMG SRC="celes.gif">

add an ALT="message you want displayed here" to the IMG SRC code.

Here's what I typed:

<IMG SRC="celes.gif" ALT="Hi, I'm Celes. Nice to meet you!">

That's it! It's that easy.

Back to top

Link Pop-Up Messages
First, try it out:

click here

Now, here's the code (Change message you want popped up here to any message you like):

<A HREF="anylinkhere" onMouseover="alert('message you want popped up here')>Click here</A>

I really don't see the purpose of this code. As far as I can see it renders the Link completely useless. I guess it could be cute if you make it into a game. You could put it with several links and have one that actually leads somewhere, while the others have a pop up that says somehting like "nope, try again". I don't know. Maybe I'm just missing the point?

Back to top

Time and Date Stamp

This code will cause the date and the time the page is loaded to be stamped on the section of the page where the code is placed. It will refresh every time the page is reloaded. Useless, but cute(I suppose):

<script>document.write("Today is "+Date()+".")</script>

Back to top

Getting Started
Standing Out
Adding Frames
Adding Tables
Little Extra's
Special extra's

Back to Back to HQ64: Nintendo and Playstation Central

Created using WordPad by ~Marie 1