Re: Hover Ads fall in behind. | |
JavaScript code can be inserted either in the head of the document (between the <head> and </head> tags) or in the body (between the <body> and </body> tags). It is a good idea to always place JavaScript code in the head if you can. <html><head><title>My Page</title>
<script language="javascript" type="text/javascript">
function myFunction() {
alert('Hello world');
}
</script>
</head>
<body>
<a href="javascript:myFunction();">Click here</a>
</body>
</html>
Since the head loads before the body, placing code in the head ensures that it is available when needed. For example, the following code will work once the page has completely loaded. <html><head><title>My Page</title> </head> <body> <a href="javascript:myFunction();">Click here</a> <script language="javascript" type="text/javascript"> function myFunction() { alert('Hello world'); } </script> </body> </html>
__________________
Best Regards,
Jeremy
|