Applets can add special effects to your page, aid navigation, alter images or just spruce up some text. When a visitor loads your web page with a Java Applet on it, the visitor's browser downloads the Applet from your server and then runs it from their own computer.
Javascript is a scripting language you can add directly to your page coding. There are no other elements to upload to your server. Javascript allows you to add many extra functions and effects to your pages. JavaFile.Com also has a wide range of Javascripts for you to use.
There are 3 steps usually needed to add an applet to your page:
Here is an example applet and it's coding:
This is the Applet's HTML code for your page: | The Java Applet: | |
<APPLET CODE="Shaking.class" WIDTH="104" HEIGHT="130"> <PARAM NAME="amplitude" VALUE="4"> <PARAM NAME="bgcolor" VALUE="#ffffff"> <PARAM NAME="picture" VALUE="picture.gif"> <PARAM NAME="shakespeed" VALUE="20"> <PARAM NAME="sound" VALUE="sound.au"> </APPLET> |
|
In this example, some of the VALUE= settings can be modified by you to add your own pictures and sound files, or adjust the color of the applet's background to match your page. Be sure to read the documentation that comes with your applet and only change the Value's specified as editable.
This example Applet requires 3 files be uploaded to the web server:
TIP: Class files are case-sensitive, so be careful when you are uploading them to a server. A lot of servers will automatically change all filenames to lowercase so you may have to rename your .class files once you have uploaded them.
There are 2 steps required to install a javascript on your page:
Try the example script we have below. Follow the steps and you should have no trouble:
<script language="JavaScript">
<!-- Hide the script from old browsers --
function loadalert ()
{alert("This is a standard javascript alertbox! Yee haa!")
}
// --End Hiding Here -->
</script>
The top of your page should now look something like this:
<HTML>
<HEAD>
<script language="JavaScript">
<!-- Hide the script from old browsers --
function loadalert ()
{alert("This is a standard javascript alertbox! Yee haa!")
}
// --End Hiding Here -->
</script>
</HEAD>
<INPUT TYPE="submit" VALUE="Click Me To Activate The Script" onClick="loadalert()">
Ok, so now try clicking your spiffy new javascript button! If you followed the steps correctly you should have a standard javascript alertbox on your page now.
Now that your pages are basically complete, you need to let the world know that your work is out there to see. The first step is to learn how to create Meta Tags: |