Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   JavaScript and Client-Side Browser Scripting (http://www.programmingforums.org/forum23.html)
-   -   Why doesnt settimeout work?? (http://www.programmingforums.org/showthread.php?t=8656)

guess Mar 1st, 2006 8:43 AM

Why doesnt settimeout work??
 
I dont wanna write all the code here,I just took that part to let u see my function is after PHP code.I couldnt solve why it is not working properly.It executes the function as if I didnt write any settimeout function there and didnt set the miliseconds property to 10000...I had this problem several of times.But I didnt face the same problem when I wrote only javascript code in one page...
:

?>

<script type="text/javascript">
setTimeout(direct(),10000);
</script>


Polyphemus_ Mar 1st, 2006 8:54 AM

:

<script type="text/javascript">
setTimeout("direct()",10000);
</script>


IIRC.

guess Mar 1st, 2006 8:57 AM

Yes right.How cant I miss that simple point.Thanx.

Cerulean Mar 1st, 2006 3:42 PM

Or
:

setTimeout(direct,10000);
setTimeout wants a string to eval or a function reference to call. setTimeout(direct(), 10000) will just make setTimeout run the return value of the `direct` function every 10000 miliseconds - not likely something you want happening, unless direct returns a reference to a function (e.g creating a closure).


All times are GMT -5. The time now is 4:41 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC