JavaScript Code



techstore
 LQ Net Home











Javascript Code

printpage    Printer Friendly Page

This page describes how to embed javascript in an HTML document.

Script in <BODY>
This example has the script element in the <body> element.
The browser will execute this code as soon as it is downloaded from the server.
<html>
<head>
<body>

<script language="Javascript" type="text/javascript">
... code goes here ...
</script>


</body>
</head>
</html>


Script in <HEAD>
This example has the script element in the <head> element.
The browser will try to run this when it loads, so usually code in the head element contains functions which are run when called.
<html>
<head>

<script language="Javascript" type="text/javascript">
... code goes here ...
</script>


</head>
</html>


External script
This example references an external javascript file.
The browser will handle the external file by downloading it and executing it.

<html>
<head>

<script language="Javascript" type="text/javascript" src="jsfile.js">
</script>


</head>
</html>










   Today's News





Office Depot, Inc

Tech Depot - An Office Depot Co.



Overstock.com, Inc.

























Copyright © 2006-2008, LQ Systems,Inc. All rights reserved.