Lab 7
In this Lab we will learn how to implement and insert basic Javascript in our web pages
- Check-in
- Javascript Tutorial: Lessons 1 - 3
- We will see now how we can place already made Javascripts inside our webpage
- Make a new folder for today's work, name it lab7.
- Inside that folder,
make another folder called javascript.
- Make a simple web page
like you did in the HTML tutorials, place it in the javascript folder.
- Go to the JavaScript
example page here and download the JS file.
Save it in the javascript folder.
- Pick a spot on your
web page, between the <BODY> </BODY> tags, and place this there:
- <script language="JavaScript"
src="jswavetext1.js"></script>
- Save your web page and
load it in a browser. You should see blue text waving across the page.
- Now go back to the lab7
folder. Make a second folder there called applets.
- Inside the applets folder,
make another simple web page.
- Go to the Java Applets
example page here and download the classes.
Save it in the applets folder.
- In the applets folder
you should have a file called classes.zip.
- Right click on the
zip file, select Extract All.
- Click Next, Next,
and Finish.
- You should now have
a folder inside applets called classes.Copy all the extracted files inside the classes folder
- Pick a spot on your
web page, between the <BODY> </BODY> tags, and place this there:
- <applet codebase="classes"
code="JavaClock.class" width="150" height="150">
<param name="delay" value="100">
<param name="link" value="http://java.sun.com/">
<param name="border" value="5">
<param name="nradius" value="80">
<param name="cfont" value="TimesRoman|BOLD|18">
<param name="bgcolor" value="ffffff">
<param name="shcolor" value="ff0000">
<param name="mhcolor" value="00ff00">
<param name="hhcolor" value="0000ff">
<param name="ccolor" value="dddddd">
<param name="ncolor" value="000000">
</applet>
- Save your web page and
load it in a browser. You should see the clock at the spot in the page you
placed the above text.
- Inside your web page between the <BODY> </BODY> tags, place the following lines of code:
-
<script type="text/javascript">
document.write("Last updated:<br>" + document.lastModified)
</script>
- Save your web page and load it in a browser.
- Check out the links on the example pages for more
JavaScripts and Applets you can add to your pages.
- Check-out
Don't forget to view the requirements for your final website!
This page is a modified version of a page created by