Is there a way of trigging a javascript at the end of the <body> tag? Like this
<html>
<body>
Do some html here
<script type="text/javascript">
How do I trig this script automaticly?
</script>
</body>
</html>
| SitePoint Sponsor |

Is there a way of trigging a javascript at the end of the <body> tag? Like this
<html>
<body>
Do some html here
<script type="text/javascript">
How do I trig this script automaticly?
</script>
</body>
</html>





Not sure I understand your question...
"The onload event occurs when the user agent finishes loading a window..." (w3.org)


this will trigger javascript at the end of the body tag, if that's what you mean?
<html>
<body>
Do some html here
<script language="javascript">
var q = "How do I trig this script automaticly?"
document.write(q);
</script>
</body>
</html>
Thomas Oeser - Blueprint Software
Web Scripting Editor v 5.2 One cool Web editing tool.
3dcomputergraphics.com Coming Soon!

Ok, check out this code:
</html>
<body>
<form action="upload.php" method="post" name ="editForm" onload="insert()">
<table border="0" width="100%" cellspacing="0" cellpadding="0" height="387">
<tr>
<td width="20%" height="21"></td>
<td width="20%" height="25"><font face="Verdana, Arial, helvetica" size="2">Mods </font></td>
<td width="20%" height="25"><input type="text" name="mods" size="20" value=""></td>
<td width="20%" height="21"></td>
<td width="20%" height="21"></td>
</tr>
</table>
</form>
<script type="text/javascript">
function insert()
{
document.editForm.mods.value = "<?echo "$mods";?>"
}
</script>
</body>
</html>
How can I make text appear in 'mods' by using javascript (and php)? The onload method doesn't seem to work.....
Last edited by Pompiuses; Jun 27, 2002 at 01:07.

ok figured it out..... it was my PHP script that messed it all up![]()
Bookmarks