lucio
01-06-2007, 02:27 PM
hello, i am new the whole javascript thing. So my problems are the BODY and HEAD tags. i have been on a few javascript websites to collect scripts for my site. And for almost every script it tells me to put into the head and body tags. but i dont understand what it means. so please if anyone can explain to me. thanks
neomaximus2k
01-06-2007, 02:54 PM
hello, i am new the whole javascript thing. So my problems are the BODY and HEAD tags. i have been on a few javascript websites to collect scripts for my site. And for almost every script it tells me to put into the head and body tags. but i dont understand what it means. so please if anyone can explain to me. thanks
This is rather simple so i'll explain for you.
When a site says insert it intot he HEAD tag what it means is this
In your website code you will see something similar to this
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
As you can see there are two header tags <HEAD> and </HEAD> so when a website says insert the javascript into your head tag it means insert it between thes two tags
e.g
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script type="Javascript">
alert("This is osme javascript");
</script>
</head>
And its the same for the body tag you will see an opener <BODY> and a closing tag </BODY> just place the code after the <BODY> tag
lucio
01-06-2007, 06:57 PM
Thanks but i dont get why the site just puts it in themselfves instead of telling us to do it
felgall
01-06-2007, 08:11 PM
Well how are they supposed to insert the script into your page? They don't even know that you want the script or even that your page exists plus they don't have access to update your site.
whizard
01-07-2007, 05:41 AM
This link may help straighten things out for you:
http://javascript.about.com/library/blheadbody.htm
HTH
Dan