Left Click anywhere on a blank part of the page for a popup menu!

Rated G

colorbar.gif

Eddie 2Dogs
Website Primer
Section 4. Java Applets and JavaScripts
colorbar.gif

JavaScript is a scripting language which has been developed by Netscape. Sorry all Microsoft IE people, but it's true.
Javascript is NOT java (the applet). Java Applets are small programs which mostly run gimmicks inside your popular browser. Javascript is a language with seemingly infinite possibilities, depending on how involved your mathematics/logic skills are.

Popular browsers (we must exclude Webtv for now, sorry it is javascript handicapped) must have Javascript enabled in your options/preferences menu. Many neophytes are stumped why their pages won't act properly and get error messages. Scripts can work hand in hand with HTML, kinda like a good marriage. You need the basics of HTML tho' before attempting to write or copy and embed these little scripts, mind you, some are not little at all.

Without going into writing Javascript we'll look at some basic copy-overs which are needed for most pages nowadays.


The infamous "popup alert"

<form>
<input type="button" value="Don't be shy...click the button" 
onClick="alert('You may copy this popup alert code over and
plunk it down anywhere on your page. Change the words
for the button value and your message.')"> </form>

Opening a NEW window

Careful, you must also provide a way to close it

Didn't work, did it...the explanation will be provided by clicking the next button, honest, it'll work this time.
Copy this code onto the page where this button will be located but we're not finished yet..gather the rest in the new window.
<form>
<input type="button" value="This works" onClick="openWin()">
</form>


The text inline window

You may copy the code over and plunk it down anywhere. Change the words for the values. There are two input tags here.

<form name="myForm">
<input type="text" name="input" value="Put a message here">
<input type="button" value="Write to the text window" 
  onClick="document.myForm.input.value= 'Good for you!'; "> 


Some "Aaarrghhh" scripts

These scripts stop you from aging prematurely. They are inserted within the HEAD tags of your pages.
  1. We've all seen the popup error message when a java script doesn't work. It usually says something like, "That function is not defined" or "illegal script, or function". Well you can stop those naughty error messages:
    Two conventions you MUST employ unless you like to have java incapable browsers display the codes, but not execute them

    <!-- These tags have a very important function...anything inside them is invisible to java-challenged browsers and adding the /* blablabla */ you can write copyrights or any message inside these, and in many cases the words "do not remove copyright information. You must keep that type of info intact or else be liable for copyright infringement and prosecution. It will look something like the following //-->
    <SCRIPT LANGUAGE="JavaScript">
    <!--/* Copyright (C) Don't know, suspect Netscape
    development. This script can be re-used or modified,
    if credit is given in the source code.
    I will not be held responsible for any unwanted effects
    due to the usage of this script or any derivative.
    No warranties for usability for any specific application
    are given or implied.
    Modified by Eddie 2Dogs--January 17,1996...you may remove
    this lengthy notice from the script when you copy it over
    because it is just an example of what to expect.*/
    function stopError() { return true; } window.onerror = stopError; // --> </SCRIPT>

    Using mouseovers to change an image in an url....
    Part 1 must be put within the <HEAD> </HEAD> tags at the top of your page...
    PART 2 must be put in the body somewhere...change the url and the two images...careful to keep both images the same size for best effect.
    PART 1
    <script language="javascript1.1">
                  <!--
                  image01= new Image(120,78)
                  image01.src="images/scream.gif"
                  image02= new Image(120,78)
                  image02.src="images/scream1.gif"
                  //-->
                  </script>
    
    PART 2 the target="_top" statement is a convention to check that the page you are linking to will not be stuck in someone's or your own frames...If you run frames leave it out...
    <a href="helpindx.html" target="_top" 
    onmouseover="filter2('example2','image02')"  
    onmouseout="filter2('example2','image01')" onclick="return true">
    <img src="images/scream.gif" name="example2" border="0"></a>
    


    click on the mouse to go to the beginning of this website primer

    Hint...image 1, the one you see is the still gif..image 2 is the animated gif which comes to the fore when the mouse is rolled over the image...for this effect to work well on all systems your images should be kept as small as possible, preferrable around 100 - 120 pixels wide and high...


    To automatically show when your were updated copy the following script to any and all of your pages at your site...If you don't want the font, change it to your liking, change or delete the copyright notice...You will see a working example just down below my index table.

    <font size=2 color="#000000">Your copyright notice here ie: © 1999 Me and me alone,
    <script language="javascript"> <!-- var update update=document.lastModified document.write(" Updated: "+update) //--> </script></font>
    Just an aside here...some servers seem to have regressed their dates (quick Y2K fixes???), it may show up on your own system before upload at the correct date and time, but once uploaded it may be a totally different date...example: this page...probably shows correct if you are at my http://eddie2dogs.org site but if you are reading this at Fortune City it will probably show December 31, 69...go figure...it was a far out year man, what I can remember of it. Oh wow...everything is waving back and forth and look at all those colors.....................*chuckle*

    On Mouseover effects, when your mouse glides over a link to display a message in the status bar of the browser (the bottom bar which usually shows the url of the link)...run your mouse over the Next Section link below and see the effect...

    <A HREF="mynextpage.html"
    onmouseover="window.status='My Next Page I Want You To Go To';return true;"
    onmouseout="window.status='This is the Basic Javascript Primer © 1999 Eddie2Dogs'">
    Next Section</A>

    Just copy and change the url and the text statements to whatever you want to say...be nice...you may also use this to drive home a copyright notice on the onmouseout section...


Next Section

The Rules Backgrounds Music Java Compatibility
Main Site Index Ratings System Icons

Copyright © 1999 Ed Ladeur,


Eddie Dog2
Box 1353
150 Mile House, BC
Canada, V0K 2G0
[email protected]