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