private_guy Posted September 7, 2007 Share Posted September 7, 2007 Hi there, I dont know if I should post this in JavaScript or PHP and other codes because I dont know what suits this. I want make a code, which after some many seconds it will disply the code. I posted it in PHP Help and they told me to post it here Example: <html> <? After 3 seconds disply ?> Hello else null <end> You know, something like that . Thanks. Best Regards, Chill_Guy Quote Link to comment Share on other sites More sharing options...
ki Posted September 7, 2007 Share Posted September 7, 2007 are u talking about a timeout? Quote Link to comment Share on other sites More sharing options...
private_guy Posted September 7, 2007 Author Share Posted September 7, 2007 Yeah I think so, this is what I want to code: I want it to disply an alert box after some many seconds Quote Link to comment Share on other sites More sharing options...
emehrkay Posted September 7, 2007 Share Posted September 7, 2007 setTimeout("alert('try me');", 500); //half a second it ultimately uses eval, so it is a little slow and be careful of it's usage Quote Link to comment Share on other sites More sharing options...
sneamia Posted September 7, 2007 Share Posted September 7, 2007 it ultimately uses eval, so it is a little slow and be careful of it's usage If you need to use a timeout repeatedly (causing lag), what would you suggest instead of setTimeout? Quote Link to comment Share on other sites More sharing options...
private_guy Posted September 7, 2007 Author Share Posted September 7, 2007 so I put that between <? and why will it use a lot of usage? Quote Link to comment Share on other sites More sharing options...
sneamia Posted September 7, 2007 Share Posted September 7, 2007 so I put that between <? and why will it use a lot of usage? <body> <script type="text/javascript"> setTimeout("alert('alert text');", 3000); </script> ... </body> Quote Link to comment Share on other sites More sharing options...
private_guy Posted September 7, 2007 Author Share Posted September 7, 2007 Thanks but why will it cause high load and usage? Quote Link to comment Share on other sites More sharing options...
emehrkay Posted September 7, 2007 Share Posted September 7, 2007 using setTimeOUt is not going to kill your app. It can be dangerous if you do not protect how script is passed into it var x = "alert('test');"; setTimeout(x,500); if x gets changed, there could be a security problem Quote Link to comment Share on other sites More sharing options...
sneamia Posted September 7, 2007 Share Posted September 7, 2007 JS Injection ftw. And private_guy, if you're question is answered, could you click topic solved? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.