<script>
$(document).ready(function() {
$('#reset_password').live('click', function(e) {
parent.$.fn.colorbox.close();
parent.$(document).bind('cbox_closed', function(){
window.location.href = "search_message_thankyou.php";
});
});
});
</script>
The script closes the colorbox as I need, but then doesn’t redirect to the thank you page. I look up whats happening in the console and this is the error:
Uncaught TypeError: Cannot read property ‘location’ of undefined
Any help would be hugely appreciated.
Many thanks in advance.
Try putting the
bindbefore you close it, like this:Alternatively you could do
parent.location.href = x.