Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javascript: Refresh parent page without entirely reloading

After a user has logged in via a fancybox (javascript) popup I wish to reload the parent page so they can access the logged in features.

Currently I am doing this with:

<a href="javascript:window.top.location.reload(true)" class="continue">Continue</a>

This works great, but the only issue is that it completely reloads the entire page: redownloads all the css & javascipt, etc.

All I want to do is reload the page normally, not a full refresh. How can I achieve this?

(I do not know the exact URL because the login can be done from any page via the fancybox, so I can't hardcode the URL.)

like image 202
Alasdair Avatar asked Apr 09 '13 08:04

Alasdair


1 Answers

Another way of reloading the page i have seen in the facebook graph api is the following:

window.location = window.location

or in your case:

window.top.location = window.top.location

This solution reloads the page without trying to resend a POST request. Might be useful. for more information look at the following SO question.

like image 77
decden Avatar answered Nov 14 '22 22:11

decden