Jump to content

How to automatically reload main page after redirected back to it


geekisthenewsexy

Recommended Posts

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. :-\

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.  :)

 

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?

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..

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.