[FX.php List] [OFF] Reload whole page from AJAX div?

Steve Winter steve at bluecrocodile.co.nz
Tue Mar 11 09:59:22 MDT 2008


Hi Joel,

Your final solution below should be the answer... in that if the file that's
called by Ajax writes the JavaScript to refresh the whole page...

I can't really see anything wrong with your JS below either... are you sure
that it doesn't work...? what does happen...?? are you sure that it's
getting returned correctly into the div...??

(I find FireFox with FireBug installed invaluable for Ajax trouble shooting,
as it shows you the calls that are made, and the responses in a window at
the bottom of your browser window ;-)

Cheers
Steve

-----Original Message-----
From: fx.php_list-bounces at mail.iviking.org
[mailto:fx.php_list-bounces at mail.iviking.org] On Behalf Of Joel Shapiro
Sent: 11 March 2008 15:53
To: FX.php Discussion List
Subject: [FX.php List] [OFF] Reload whole page from AJAX div?

Hi all

I've got a page that reloads divs via AJAX (links within a div reload  
that same div).

I want to have the *whole page* reload (not just the div) if the  
session has timed out, however I can't figure out how to do this.

If I use
   header('Location: page.php');
then page.php reloads only in that div

I can use Javascript in a link in the div that will reload the whole  
page, e.g.:
   <a href="#" onclick="location.replace('page.php')">click</a>
but I'd like this to be automated, so clicking a link in a div that  
would normally reload just that div will instead reload the whole  
page whenever the session has timed out.

I've tried:
   <script language="javascript">
   <!--
   location.replace("page.php");
   -->
   </script>
but that didn't work (even though I was able to get it to work in  
another simpler situation).

Any suggestions?

TIA,
-Joel
_______________________________________________
FX.php_List mailing list
FX.php_List at mail.iviking.org
http://www.iviking.org/mailman/listinfo/fx.php_list




More information about the FX.php_List mailing list