voip03 Posted August 2, 2011 Share Posted August 2, 2011 <html> <head> </head> <body> <h2> hello</h2> <body onLoad="setTimeout('delayer()', 5000)"> <h3> Hello world</h3> </body> </body> </html> can write a code like it? Quote Link to comment Share on other sites More sharing options...
WebStyles Posted August 2, 2011 Share Posted August 2, 2011 did you try it ? Quote Link to comment Share on other sites More sharing options...
voip03 Posted August 2, 2011 Author Share Posted August 2, 2011 yes js but with body tag and onlod ;i am struggling how can i sort it out Quote Link to comment Share on other sites More sharing options...
WebStyles Posted August 2, 2011 Share Posted August 2, 2011 <html> <head> <script> function delayer(){ alert("it works"); } </script> </head> <body onLoad="setTimeout('delayer()', 5000)"> <h2> hello</h2> <h3> Hello world</h3> </body> </body> </html> Quote Link to comment Share on other sites More sharing options...
IrOnMaSk Posted August 2, 2011 Share Posted August 2, 2011 why not just [code} <html> <head> </head> <body onLoad="setTimeout('delayer()', 5000)"> <h2> hello</h2> <h3> Hello world</h3> </body> </html> lol what are you trying to accomplish? really interesting though Quote Link to comment Share on other sites More sharing options...
voip03 Posted August 2, 2011 Author Share Posted August 2, 2011 timedelay for redirect page Quote Link to comment Share on other sites More sharing options...
voip03 Posted August 2, 2011 Author Share Posted August 2, 2011 WebStyles 1st I need header.php after header.php only i need onlod. that why i try to use body tag 2 time. it is working 100% ok. but i want to make sure is it a correct method. Quote Link to comment Share on other sites More sharing options...
WebStyles Posted August 2, 2011 Share Posted August 2, 2011 what do you mean? where does header.php come form, what code is in it? Quote Link to comment Share on other sites More sharing options...
voip03 Posted August 2, 2011 Author Share Posted August 2, 2011 <html> <head> <script type="text/javascript"> <!--function delayer(){ window.location = "../javascriptredirect.php"}//--></script> </head> <? reqiuure(header.php); ?> <h2> hello</h2> <body onLoad="setTimeout('delayer()', 5000)"> <h3> Hello world</h3> </body> </body> </html> Quote Link to comment Share on other sites More sharing options...
WebStyles Posted August 2, 2011 Share Posted August 2, 2011 what code is in header.php ? Quote Link to comment Share on other sites More sharing options...
voip03 Posted August 2, 2011 Author Share Posted August 2, 2011 <body> siginin.php search.php likemore... Quote Link to comment Share on other sites More sharing options...
WebStyles Posted August 2, 2011 Share Posted August 2, 2011 well if the <body> tag is inside header.php, put <body onLoad="setTimeout('delayer()', 5000)"> inside header.php and remove from main file. Quote Link to comment Share on other sites More sharing options...
voip03 Posted August 2, 2011 Author Share Posted August 2, 2011 delay action only for one page Quote Link to comment Share on other sites More sharing options...
WebStyles Posted August 2, 2011 Share Posted August 2, 2011 echo this anywhere else in the code: echo '<script>setTimeout('delayer()', 5000);</script>'; Quote Link to comment Share on other sites More sharing options...
voip03 Posted August 3, 2011 Author Share Posted August 3, 2011 Thank u WebStyles can i use jquery? last 2h i am trying to write code using jq, still i can not get the time delay. Quote Link to comment Share on other sites More sharing options...
TeNDoLLA Posted August 3, 2011 Share Posted August 3, 2011 Don't think it is a good idea to use multiple body tags, since it won't be valid HTML. Some browsers might give you unexpected results if you use multiple body tags. And yes, you can use jQuery for the delay thing. It has already premade function for it: http://api.jquery.com/delay/ . Theres also some examples. Quote Link to comment Share on other sites More sharing options...
voip03 Posted August 3, 2011 Author Share Posted August 3, 2011 But i am not sure how to corporate jquery and redirect 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.