I am using Thickbox 3.1 for a login form, using the iframe version.
I want to close the iframe (child) window, then refres开发者_如何学Ch the parent window.
This closes the iframe window, but I need to somehow set it to refresh the parent window
<a href="#" onclick="self.parent.tb_remove();">Close</a>
Any help is appreciated.
This should do it:
<a href="#" onclick="self.parent.tb_remove(); window.location.reload()">Close</a>
Edit: Maybe that should be:
self.parent.location.reload()
?
try
<a href="#" onClick="parent.location.reload(1)">Close</a>
worked for me
How about:
self.parent.location = "page_to_reload";
Bear in mind that whatever your page is doing isn't instantaneous. For my site I set new values in a table (MySQL) and I had to add a timeout.
I had to do: setTimeout(function(){parent.location.reload(1)},1000)
Also used this modification to the .js file: http://designerfoo.com/jquery-thickbox-hack-to-refresh-parent-window-on-tb_close-event.html
精彩评论