Wednesday, October 28, 2009

Javascript : Close Thickbox and Refresh parent page

Choice 1 : When click the grey overlay, or close link or press escape key will remove ThickBox and refresh the parent page.

In the thickbox.js, add a line in the tb_remove() function
function tb_remove() {
if (typeof == "undefined") {//if IE 6
$("body","html").css({height: "auto", width: "auto"});
document.onkeydown = "";
document.onkeyup = "";
parent.location.reload(1); // Add this line
return false;

Choice 2 : Click a button to close the thickbox and refresh the parent page
<button onClick="parent.tb_remove(); parent.location.reload(1)">Close It</button>

Taken From :

Related Links:
Lightbox 2


  1. Replies
    1. Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a Front end developer learn from Javascript Training in Chennai . or learn thru JavaScript Online Training in India. Nowadays JavaScript has tons of job opportunities on various vertical industry. JavaScript Training in Chennai

  2. good Thanks so much>>>>>