My issue is that I need a colorbox to reload the parent page on close.
This is what I have:
$(".example").colorbox({
onClosed:function(){
parent.location.reload();
}
});
Colorbox loads fine, but doesn't refresh the parent page on close. Any Ideas?
Use window.location.reload();
or window.location = window.location;
instead of parent.location.reload();
A bit delayed, but I've got another answer. You can send the code to reload window from the target page that gets loaded in colorbox.
I was using the colorbox for login/how_it_works/faqs & few other functions. I wanted my parent page to reload only in case of 'login'. So, in response to login form, I sent the following code:
<script type="text/javascript">
window.parent.location.reload();
</script>
'window' is colorbox window. I'm asking its parent (browser window) to reload.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With