|


Need help with
something? Click here for the WebA hotline!
Visit
out Message Boards!
Take
our webmaster test and see if you can earn a high score!
View our real "Intro"
| |
You know how people have different accents? That's kind of the way it is with
Java. You have the main language, Java, and then several languages/accents that
are similar to that. Look at the different accents there are: Brittish,
American/Canadian, country, Australian, Boston, New York/Jersey, each one sounds
a little different, but everyone is speaking the same language.
Java, JavaScript...and then the computer programs that are embedded in web pages
using Java(script)...JavaApplets, And Shock-Baubles. Though each one of them
uses the same basic syntax, or vocabulary as we'd say it, they are distinctly
different.
What exactly is Java?
It's an object oriented computer language. It can interact with just about any
object, or file. Instead of being based on commands, it's based on objects.
"What can I do with this file?" "How can I work within this
browser window?"
What are the differences between the different Java programs?
Java, like C++, is a difficult language to learn and use on the Internet. So,
Sun Microsystems and Netscape put their heads together and created a language
similar to Java that would be easy to embed(insert), in HTML documents (web
pages).
The result was JavaScript.
JavaApplet is not a computer language per se, but rather a miniature computer
program that can be viewed online. The computer program was made using Java.
example.
Shock-Baubles, are similar to applets, they are computer programs, but have a
smaller file size (12kb max), and are made with shockwave. Why are we talking
about them in the Java section? Because we use JavaScript to embed them in our
document. Also they are a higher-quality alternative to JavaApplets IMHO.
The Simplest JavaScript in The World
<JORDAN! Paste script here to show how it works.>
Use step 1-2 on the following:
<FORM>
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<INPUT TYPE="button" VALUE="Click here to see how it
works"
onClick='alert("There. It worked, happy now?")'>
</FORM>
</CENTER>
The Classic Scroll Script
A lesson in multiline code and variables...
What it does...(Link to page where it does this)
(click here for navigation steps)
Follow steps 1 and 2 with the following script:
<SCRIPT LANGUAGE="JavaScript">
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Begin
function scrollit(seed) {
var m1 = "INSEERT YOUR FIRST MESSAGE HERE ";
var m2 = "INSERT YOUR SECOND MESSAGE HERE";
var m3 = "INSERT YOUR THIRD MESSAGE HERE ";
var m4 = "";
var msg=m1+m2+m3+m4;
var out = " ";
var c = 1;
if (seed > 100) {
seed--;
cmd="scrollit("+seed+")";
timerTwo=window.setTimeout(cmd,100);
}
else if (seed <= 100 && seed > 0) {
for (c=0 ; c < seed ; c++) {
out+=" ";
}
out+=msg;
seed--;
window.status=out;
cmd="scrollit("+seed+")";
timerTwo=window.setTimeout(cmd,100);
}
else if (seed <= 0) {
if (-seed < msg.length) {
out+=msg.substring(-seed,msg.length);
seed--;
window.status=out;
cmd="scrollit("+seed+")";
timerTwo=window.setTimeout(cmd,100);
}
else {
window.status=" ";
timerTwo=window.setTimeout("scrollit(100)",75);
}
}
}
// End -->
</SCRIPT>
Now continue with steps 3-5. Scroll through the text, to where it reads:
var m1 = "INSEERT YOUR FIRST MESSAGE HERE ";
var m2 = "INSERT YOUR SECOND MESSAGE HERE";
var m3 = "INSERT YOUR THIRD MESSAGE HERE ";
You can insert what YOU want it to say. So it might look like this:
var m1 = "Hello world ";
var m2 = "Zup?";
var m3 = "Check it out dude ";
Congratulations! You have just mastered a technique called Editing Variables!
Complete Step 7.
Follow steps 1-2 copying this code:
<BODY onLoad="scrollit(100)">
Now paste this in a different HTML Tag.
Press ok, and then you can preview it.
No you have a feel for what you can do with some simple JavaScript codes.
Go to part II of IV.
|