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? Link to comment https://forums.phpfreaks.com/topic/243633-html-help/ Share on other sites More sharing options...
WebStyles Posted August 2, 2011 Share Posted August 2, 2011 did you try it ? Link to comment https://forums.phpfreaks.com/topic/243633-html-help/#findComment-1250905 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 Link to comment https://forums.phpfreaks.com/topic/243633-html-help/#findComment-1250908 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> Link to comment https://forums.phpfreaks.com/topic/243633-html-help/#findComment-1250910 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 Link to comment https://forums.phpfreaks.com/topic/243633-html-help/#findComment-1250911 Share on other sites More sharing options...
voip03 Posted August 2, 2011 Author Share Posted August 2, 2011 timedelay for redirect page Link to comment https://forums.phpfreaks.com/topic/243633-html-help/#findComment-1250913 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. Link to comment https://forums.phpfreaks.com/topic/243633-html-help/#findComment-1250915 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? Link to comment https://forums.phpfreaks.com/topic/243633-html-help/#findComment-1250919 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> Link to comment https://forums.phpfreaks.com/topic/243633-html-help/#findComment-1250922 Share on other sites More sharing options...
WebStyles Posted August 2, 2011 Share Posted August 2, 2011 what code is in header.php ? Link to comment https://forums.phpfreaks.com/topic/243633-html-help/#findComment-1250937 Share on other sites More sharing options...
voip03 Posted August 2, 2011 Author Share Posted August 2, 2011 <body> siginin.php search.php likemore... Link to comment https://forums.phpfreaks.com/topic/243633-html-help/#findComment-1250938 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. Link to comment https://forums.phpfreaks.com/topic/243633-html-help/#findComment-1250939 Share on other sites More sharing options...
voip03 Posted August 2, 2011 Author Share Posted August 2, 2011 delay action only for one page Link to comment https://forums.phpfreaks.com/topic/243633-html-help/#findComment-1250940 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>'; Link to comment https://forums.phpfreaks.com/topic/243633-html-help/#findComment-1250949 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. Link to comment https://forums.phpfreaks.com/topic/243633-html-help/#findComment-1251136 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. Link to comment https://forums.phpfreaks.com/topic/243633-html-help/#findComment-1251164 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 Link to comment https://forums.phpfreaks.com/topic/243633-html-help/#findComment-1251188 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.