Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Mar 1st, 2006, 8:43 AM   #1
guess
Programmer
 
Join Date: Feb 2006
Posts: 40
Rep Power: 0 guess is on a distinguished road
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>
guess is offline   Reply With Quote
Old Mar 1st, 2006, 8:54 AM   #2
Polyphemus_
Expert Programmer
 
Polyphemus_'s Avatar
 
Join Date: Aug 2005
Location: Rotterdam, the Netherlands
Posts: 942
Rep Power: 4 Polyphemus_ is on a distinguished road
<script type="text/javascript">
setTimeout("direct()",10000);
</script>

IIRC.
Polyphemus_ is offline   Reply With Quote
Old Mar 1st, 2006, 8:57 AM   #3
guess
Programmer
 
Join Date: Feb 2006
Posts: 40
Rep Power: 0 guess is on a distinguished road
Yes right.How cant I miss that simple point.Thanx.
guess is offline   Reply With Quote
Old Mar 1st, 2006, 3:42 PM   #4
Cerulean
Professional Programmer
 
Cerulean's Avatar
 
Join Date: Apr 2005
Location: London, England
Posts: 459
Rep Power: 4 Cerulean is on a distinguished road
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).
Cerulean is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 3:18 AM.

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