Greg Amer

Start Page

start

b-1


JavaScript:
gascripts.com  

 

Hard Reload
To See Menu

JavaScript...

is an object oriented scripting language used to manipulate the browser environment. It was designed jointly by Netscape and Sun Microsystems as a platform-independent language. JavaScript's are a run-time applications performed on the clients computer resulting in HTML documents can become more interactive.

The main components of JavaScript are objects, event handlers, and functions. Objects are the definable elements of a browsers environment. Event handlers trigger responses to events that take place in the browsers environment. Functions are segments of code which define the events that the browser will carry out.

JavaScript is written directly inside the HTML document using the tags

<script language="JavaScript"> script code </script>

or it is called from an external source using the HTML tags

<script language="JavaScript" src="src.js"></script>

An actual HTML document using JavaScript might look like this...

example

<html>
<head>
<title>Start Page</title>
<script language="JavaScript">
<!--

The document type <html> is declared.
This document embeds the
JavaScript within the  <head> tags of the document.
HTML
<!-- comment tags prevent old browsers from tripping up.      

function test_(){

var string_ = document.test.one.value
document.test.two.value= string_ }

The function test_() is used to adjust the value of the second text box.    

// -->
</script>
</head>
<body>

All tags must be closed in order.

<form name="test">
<input type="text" name="one" onBlur="test_()">
<input type="text" name="two">
</form>

The form test has two form elements, the text objects one& two.

</body>
</html>

 


[home]   [next]