On Thu, 29 Jul 2004 20:46:14 +0000, George Hester wrote:
I tried it. I didn't work. Let me be nore specific:
Msg = "1<div>2<div>3< div>4<div>5<div >6"
change() just changes the visibility status of a div in the page. When
Msg="" then the div is hidden. When Msg<>"" then the div is visible.
So I did this:
setInterval("ch ange('+Msg+');" ); which I believe is what you had. First
the string concatenation doesn't look right and so I can understand why
it doesn't work. I did try setInterval("ch ange("+Msg+")") ; but no good
also.
Thanks though.
I assure you the PHP example I gave you works. I'm not sure if I got the
pure JavaScript example right.
Does your function work if it's not being called by setInterval? Make sure
the function itself works before you try to use setInterval because
debugging it inside setInterval is a nightmare.
Oop... wait a second... I just found an example I wrote that isn't
encapsulated in PHP:
<html>
<head>
<title>clock</title>
<script type='text/JavaScript'>
function GetTime(TimeAnc hor) {
today = new Date();
TimeAnchor.inne rHTML = today.toLocaleS tring(); delete today;
}
function UpdateTime(Time Anchor) {
GetTime(TimeAnc hor);
setInterval("Ge tTime(document. getElementById( '" + TimeAnchor.id +
"'))", 1000);
}
</script>
</head>
<body>
<span id='DateTime'></span>
<script type='text/JavaScript'>
UpdateTime(docu ment.getElement ById("DateTime" ));
</script>
</body>
</html>
This should print a running clock on the page (works in IE and Moz).
--
i.m.
The USA Patriot Act is the most unpatriotic act in American history.