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> |
Very Nice Concept to posting...
ReplyDeletehttp://v24sguys.wordpress.com/
ReplyDeletesupreme outlet
ReplyDeletesupreme clothing
golden goose
moncler outlet
golden goose
golden goose sale
golden goose outlet
supreme clothing
goyard wallet
moncler jackets
xiaofang20191213
salt likit
ReplyDeletesalt likit
dr mood likit
big boss likit
dl likit
dark likit
56V