To invoke thickbox using javascript

Mohan Ram picture Mohan Ram · Dec 1, 2010 · Viewed 10.3k times · Source

How to invoke a thickbox using javascript function. I am using this code.

//javascript function
function click_fn()
{
 self.location="upload.php?keepThis=true&TB_iframe=1&width=1000&height=400&model=true";
}

Answer

Mohan Ram picture Mohan Ram · Dec 1, 2010

Calling Thickbox via JavaScript


var url = "http://www.blah.com/something?KeepThis=true&TB_iframe=true&width=300&height=200";
tb_show("My Caption", url);

Syntax: tb_show(caption, url, imageGroup)

Code allows to call thickbox from javascript.