Javascript setTimeout() issue
Posted: Mon Aug 12, 2002 2:36 am
I've got a weird issue with using a setTimeout() call. If I place the following code in to a HTML doc, it works fine.
That's all well and good, but I don't like seeing my js in the html source for when I am debugging (weird I know). So I would change it to
The problem is when I do that, the script loads, but the actual timer fails. Can anyone tell me why, or offer advice on how to overcome this without having to include() all my js scripts?
TIA. =)
Code: Select all
<html>
<head>
<script language="Javascript">
function dt() {
t=new Date();
window.status=t.toString();
setTimeout("dt()",1000);
}
dt();
</script>
</head>
<body>
</body>
</html>Code: Select all
<html>
<head>
<script language="Javascript" src="/path/to/myscript.js">
</head>
<body>
</body>
</html>TIA. =)