home

java and javascript library

Because Java applets are platform-independent, CityStar's Virtual Server System is quite capable of supporting pre-compiled Java classes. JavaScript is also supported.

onAbort image
onClick button, checkbox, radio, link, reset, submit, area
onFocus select, text, testarea
onMouseOver link, area
onMouseOut link, area
onSelect text,text area
onSubmit form
onReset form
onBlur select, text, text area
onChange select, text, text area
Non-interactive event handlers
handler used in
onError image
onLoad windows, image
onUnload window
onAbort

An onAbort event handler executes JavaScript code when the user aborts loading an image.

Example:


<HTML>
<HEAD>
<TITLE> Example of onAbort Event Handler </TITLE>
</HEAD>
<BODY bgcolor="ffffff">
<H3>Example of onAbort Event Handler:</H3>
<STRONG>Stop the loading of this image 
and see what happens:</STRONG><BR><>
<IMG  SRC="http://artie.com/roysmith/sleeping.jpg" 
onAbort="alert('You stopped loading the image!')">
</body>
</HTML>

See this script work.

Here, an alert() method is called using the onAbort event handler when the user aborts loading the image.

onClick
In an onClick event handler, a JavaScript function is called when an object in a button (regular, radio, reset and submit) is clicked, a link is pushed, a checkbox is checked or an image map area is selected. Except for the regular button and the area, the onClick event handler can return false to cancel the action. For example,

<INPUT TYPE="submit" NAME="mysubmit" VALUE="Submit" onClick="return

confirm(`Are you sure you want to submit the form?')">



Note: With Microsoft Windows, the onClick event handler does not work with reset buttons.

Example: <HTML> <HEAD><TITLE> Example of onClick Event Handler</TITLE> <SCRIPT LANGUAGE="JavaScript"> function valid(form){ var input=0; input=document.myform.data.value; alert("Hello " + input + "! Welcome..."); } </SCRIPT> </HEAD> <BODY BGCOLOR="FFFFFF" TEXT="000000"> <H3>Example of onClick Event Handler</H3> Click on the button after entering your name into the text box:<BR> <form name="myform"> <input type="text" name="data" value="" size=10> <INPUT TYPE="button" VALUE="Click Here" onClick="valid(this.form)"> </form> </BODY> </HTML>

See this script work.

In this example, when the user clicks the button "Click Here", the onClick event handler calls the function valid().

onFocus
An onFocus event handler executes JavaScript code when input focus enters the field either by tabbing in or by clicking but not selecting input from the field. For windows, frames and framesets the event handler executes JavaScript code when the window gets focused. In windows you need to specify the event handler in the <BODY> attribute. For example,

<BODY BGCOLOR='#ffffff'

onFocus="docuement.bgcolor='#000000'">

Note: With Microsoft Windows, the onFocus event handler does not work with <FRAMESET>.

Example:

<HTML>

<HEAD><TITLE> Example of onFocus Event Handler </TITLE>

</HEAD>

<BODY BGCOLOR="FFFFFF" TEXT="000000">

<H3>Example of onFocus Event Handler</H3>

Put your mouse into the text box:<BR>

<form name="myform">

<input type="text" name="data" value=""

size=10 onFocus="alert('You focused the textbox!!')">

</form>

</BODY>

</HTML>

See this script work.

In the above example, when you put your mouse on the text box, an alert() message displays a message.

onMouseOver
JavaScript code is called when the mouse is placed over a specific link or an object or area from outside that object or area. For the area object the event handler is specified with the <AREA> tag. For example:



<MAP NAME="mymap">

<AREA NAME="FirstArea" COORDS="0,0,49,25" 

HREF="mylink.htm"

onMouseOver="self.status='This will take you to mylink.htm';

return true">

</MAP>

Example: <HTML> <HEAD><TITLE> Example of onMouseOver Event Handler </TITLE> </HEAD> <BODY BGCOLOR="FFFFFF" TEXT="000000"> <H3> Example of onMouseOver Event Handler</H3> Put your mouse over <A HREF="nw-onmouseover-javascript.htm" onMouseOver="window.status='Hello! How are you?' ; return true;"> here</A> and look at the status bar. </BODY> </HTML>

See this script work.

In the above example when you point your mouse to the link, the text "Hello! How are you?" appears on your window's status bar.

onMouseOut
JavaScript code is called when the mouse leaves a specific link or an object or area from outside that object or area. For area object the event handler is specified with the <AREA> tag.

Example:

<HTML>

<HEAD><TITLE> Example of onMouseOut Event Handler </TITLE>

</HEAD>

<BODY BGCOLOR="FFFFFF" TEXT="000000">

<H3>Example of onMouseOut Event Handler</H3>

Put your mouse over <A HREF="java/nw-onm~2.htm"

onMouseOut="window.status='You left the

link!' ; return true;"> here</A>

and then take the mouse pointer away.

</BODY>

</HTML>

See this script work.

onSelect
A onSelect event handler executes JavaScript code when the user selects some of the text within a text or textarea field.

Example:

<HTML>

<HEAD><TITLE> Example of onSelect Event Handler </TITLE>

</HEAD>

<BODY BGCOLOR="FFFFFF" TEXT="000000">

<H3>Example of onSelect Event Handler</H3>

Select the text from the text box:<br>

<form name="myform">

<input type="text" name="data" value="Select This" size=20

onSelect='alert("This is an example of onSelect!!")'>

</form>

</BODY>

</HTML>

See this script work.

In the above example, when you try to select the text or part of the text, the alert method displays the message, "This is an example of onSelect!!"

In the above example, after pointing your mouse and leaving the link , the text "You left the link!" appears on your window's status bar.

onSubmit
An onSubmit event handler calls JavaScript code when the form is submitted.

Example:





<HTML>

<HEAD><TITLE> Example of onSubmit Event Handler </TITLE>

</HEAD>

<BODY BGCOLOR="FFFFFF" TEXT="000000">

<H3>Example of onSubmit Event Handler</H3>

Type your name and press the button<BR>

<form name="myform" onSubmit='alert("Thank you " 

+ myform.data.value +"!")'>

<input type="text" name="data">

<input type="submit" name ="submit" 

value="Submit this form">

</form>

</BODY>

See this script work.

In this example, the onSubmit event handler calls an alert() function when the button "Submit this form" is pressed.

Go to Javascript page 2


Java applets and Javascript are supported by the CityStar Virtual Server System. CityStar® has selected some very functional applets and provided easy to follow installation instructions for its customers.


FAQ | Downloads | CGI | Java | About Domains | Self Help | Info Request | Modules | Home

Copyright © 2003, CityStar® Online - All Rights Reserved.

Contact us:
To place an order now or for pre-sales questions call: 1.719.574.5956
sales@citystar.com
For Technical Support call: 1.719.559.4664, enter reference code 1000
support@citystar.com

CityStar® Group, Inc. - 3645 Jeannine Drive, Suite 211 - Colorado Springs, CO 80917 USA