JavaScript

 

1) Where to Find JavaScript:  Many Sites offer Freeware Scripts

2) Steps to use a pull-down menu

  1. Go out to http://www.colorado.edu/geography/gfda/gfda.html: in Internet Explorer.
  2. View: Source  (this will show you the html code for this page in Notepad)
  3. In this Notepad pop up window, copy the following:

    <script language="JavaScript">



<!-- Begin

function formHandler(form){var URL = document.form.site.options[document.form.site.selectedIndex].value;
window.location.href = URL;}

// End -->


</script>

 

This portion should go after <head> and before </head> in your html document.

    6.   Next, copy and paste the following code.  Paste the code where you want the applet to appear in your webpage.

<form name="form" style="float: right;">               
              <select name="site" onchange="javascript:formHandler()" size="1">
<option selected="selected">Go to....</option>
<option value="gfda.html">Homepage</option>
<option value="workshops/workshops.html">Workshops</option>
<option value="resources/resources.html">Resources</option>
</select>
</form>

    7.  Change navigation links to suit your webpage.  For example, mine looks like this:

<form name="form" style="float: right;"> <!-- The style float: right will align this script to the right of your page. -->

<select name="site" size=1 OnChange="javascript:formHandler()">

<option>Go to....</option>

<option value="http://www.colorado.edu/geography/foote/geog4043/geog4043.html">Cart2</option>

<option value="http://www.colorado.edu/geography/foote/geog4043/students/students.html">Fall 2009</option>

<option value="http://www.colorado.edu/geography/">Geography</option>

 

</select>

</form>

    8.  Save, publish, and your done!

3) Steps to use a pop-up window java script

  1. Go out to http://www.colorado.edu/geography/foote/mapdesign/mapdesign.html: in Internet Explorer.
  2. View: Source  (this will show you the html code for this page in Notepad)
  3. In this Notepad pop up window, copy the following:
<script language="JavaScript">



function WinOpenUseaweb() {

msg=open("authoring-a.html","Useaweb","toolbar=no,directories=no,resizable=no,width=650,height=500,scrollbars=yes");

}

Paste it after <head> and before </head> in your html document.
Then add this to close the script below the last line above:

</script>

Where it says "WinOpenUseaweb", this is the function to open an html document in a pop-up.
Change this to say "WinOpenGIF"; the function is "WinOpen<the name you choose>".
Where it says "authoring-a.html", that is the name of the document that will open in the pop-up window.
Change "authoring-a.html" to the document you want to use (make sure that document is in the same folder as this document you are making).
Where it says "Useaweb", that is the code connector used for the link.
Change "Useaweb" to something that makes sense to you, like "GIF". It's just a code name to activate this script.
You should also change the width and height of the pop-up appropriately.
  1. Now go to the body of the code and look for the following and copy it:
<a
 href="JavaScript:WinOpenUseaweb()"
 onmouseover="window.status='Use a web'; return true">A.
Use a web planner to envision module goals and materials</a>

Paste this text into the body of your html document, between <body> and </body>.

Change "WinOpenUseaweb" to "WinOpenGIF", just like above.
Change "window.status='Use a web' to "window.status='GIF', this must be the same code connector above.
Finally, change "A. Use a web planner to envision module goals and materials" to the actual text you want the link to be. For example, "Animated GIF".

  1. Save your file, make sure the file you want to open in a pop-up is in the same folder.
  2. Publish to test it.




<>created 2006.2.6.  kef
revised 2009.9.19 gjm