geekisthenewsexy Posted November 8, 2010 Share Posted November 8, 2010 hi guys. i was wondering if anyone of you can help me. as stated in the subject, i want to be able to reload the main page after being redirected to it from another page. please take note that this is on one window only.. i am using this function on the other page: <script language="JavaScript"> function goback() { history.go(-1) //****script to automatically reload main??****// } <!--/script> <body onload="setTimeout('goback()',5000)"> i am using FF v3.6.8 browser on this by the way. i figured posting my browser's version so that you will know if ever there are compatibility issues on the script, which i hope it doesn't have. thanks in advance guys. :-\ Quote Link to comment https://forums.phpfreaks.com/topic/218066-how-to-automatically-reload-main-page-after-redirected-back-to-it/ Share on other sites More sharing options...
Adam Posted November 8, 2010 Share Posted November 8, 2010 Personally I'd avoid using JS' history.go() method, or any form of JS based redirection for that matter. Can you not do this without needing to use JS? Quote Link to comment https://forums.phpfreaks.com/topic/218066-how-to-automatically-reload-main-page-after-redirected-back-to-it/#findComment-1131781 Share on other sites More sharing options...
brianlange Posted November 9, 2010 Share Posted November 9, 2010 How about using window.location window.location="http://website.com/mainpage.html"; Quote Link to comment https://forums.phpfreaks.com/topic/218066-how-to-automatically-reload-main-page-after-redirected-back-to-it/#findComment-1132327 Share on other sites More sharing options...
geekisthenewsexy Posted November 11, 2010 Author Share Posted November 11, 2010 hi guys, sorry for the delayed response. been busy with work lately. anyway, Can you not do this without needing to use JS? uhm, sorry MrAdam i don't know any other method..is there another way?i mean i'm not really familiar with JS and all but if there is, can it effectively execute what i wanted? and How about using window.location window.location="http://website.com/mainpage.html"; thanks brianlange, i'll try this one out. Quote Link to comment https://forums.phpfreaks.com/topic/218066-how-to-automatically-reload-main-page-after-redirected-back-to-it/#findComment-1132936 Share on other sites More sharing options...
Adam Posted November 11, 2010 Share Posted November 11, 2010 I didn't mean specifically the same action, but rather re-thinking the flow of the application to not require a reload after 5 seconds. JavaScript like that can be really annoying from a user's point of view. Firstly; why is it you need to reload the page after 5 seconds? Quote Link to comment https://forums.phpfreaks.com/topic/218066-how-to-automatically-reload-main-page-after-redirected-back-to-it/#findComment-1132950 Share on other sites More sharing options...
geekisthenewsexy Posted November 12, 2010 Author Share Posted November 12, 2010 hi, well that page contains a confirmation based on the action from the previous page. and i want the user to be informed about what he just did, like if it's a success or not. but anyway it's okay now. i used window.location .. but is that okay?i mean it's still jscript.. Quote Link to comment https://forums.phpfreaks.com/topic/218066-how-to-automatically-reload-main-page-after-redirected-back-to-it/#findComment-1133324 Share on other sites More sharing options...
Adam Posted November 12, 2010 Share Posted November 12, 2010 Personally I'd just display the confirmation on the page you're redirecting them to. If you're after a nice little effect for it too, you could use jQuery to fadeOut() the element, or some other effect. Quote Link to comment https://forums.phpfreaks.com/topic/218066-how-to-automatically-reload-main-page-after-redirected-back-to-it/#findComment-1133374 Share on other sites More sharing options...
geekisthenewsexy Posted November 15, 2010 Author Share Posted November 15, 2010 nah, i think i'll just stick to it. thanks though! Quote Link to comment https://forums.phpfreaks.com/topic/218066-how-to-automatically-reload-main-page-after-redirected-back-to-it/#findComment-1134267 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.