Here you can find a number of examples on Java Script.Please find the various kinds of examples listed on the right side of this site. If you don't find anything on Java Script then please write to us or leave a commnet. We are pleased to help and find the solution of your problem.

JavaScript Where To



JavaScripts in the body section will be executed WHILE the page loads.

JavaScripts in the head section will be executed when CALLED.




Script in the Head Section: Scripts to be executed when they are called, or when an event is triggered, go in the head section.

<html>
<head>
<title>......</title>
<script language="javascript">
...Write your Jvascript code hear...
</script>

</head>
<body>
HTML Statements
</body>
</html>


Scripts in the body section: Scripts to be executed when the page loads go in the body section

<html>
<head>
<title>......</title>
</head>
<body>
<script language="javascript">
...Write your Jvascript code hear...
</script>

HTML Statements
</body>
</html>


Scripts in both the body and the head section: You can place an unlimited number of scripts in your document, so you can have scripts in both the body and the head section.

<html>
<head>
<title>......</title>
<script language="javascript">
...Write your Jvascript code hear...
</script>

</head>
<body>
<script language="javascript">
...Write your Jvascript code hear...
</script>

</body>
</html>




Using an External JavaScript

you want to run the same JavaScript on several pages, without having to write the same script on every page.To simplify this, you can write a JavaScript in an external file. Save the external JavaScript file with a .js file extension.

Note: The JavaScript external File/script cannot contain the <script> tag!

To use the external script, point to the .js file in the "src" attribute of the <script> tag:

<html>
<head>
<script language="javascript" src="FileName.js"></script">
</head>
<body>
</body>
</html>



2 comments:

  1. Very Nice Concept to posting...

    ReplyDelete
  2. http://v24sguys.wordpress.com/

    ReplyDelete

Google