Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

new to vbscript cant understand this 1

Status
Not open for further replies.

happyworld1

IS-IT--Management
Jan 29, 2003
2
US
I saw on some site written;

Head section
Scripts can be placed in the head section. Usually we put all the "functions" in the head section. The reason for this is to be sure that the script is loaded before the function is called.

Body section
Execute a script that is placed in the body section. Scripts in the body section are executed when the page is loading.

how does it differ if we put the script in head or body??Pls explain
thanks

 
Scripts are usually put in head section to clarify page coding. When you want to find a script, it's more simple to go th head rather than to seek all the page to find the good script tag when dispached in all page. Water is not bad as long as it stays out human body ;-)
 
thanks targol very much for ur reply but if u dont mind can u clarify it a alittle bit more coz iam totally new to this vb script and may not understand te whole terminolgy
thanks
 
i think you're talking about html pages, which typically have a head (hidden stuff) and a body. The contents of the head is loaded b4 the body. the body is what u see on a webpage.
the structure in html is
<html>
<head>
head stuff, meta tags, javascript functions etc
</head>
<body>
html code, what u see, forms etc
</body>
</html>


When using javascript it's normal to put all the functions in the head section so they are in memory b4 the body section loads.
obviously it wouldnt be good to run functions b4 their code is loaded ok?

===============
Security Forums
 
that was javascript which is a client-side language. Vbscript is typically used as a server side language in the enviroment of ASP (active server pages)

in a server side language, a webpage coded in asp is loaded by the server, and any code embedded within it, anywhere, is resolved. i dont think it matters where the code is.
You can have html tags or vbscript that outputs html tags, depends how u write your code.
after the code has been executed the resulting webpage is sent down the wire to the user's browser.


===============
Security Forums
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top