Thursday, April 16, 2009

jQuery (1.3.2) w/ Thickbox (3.1) and Java .action hack

Here goes:

While trying to incorporate jQuery Thickbox into my JSP page I encountered a problem. The problem being is that I did not want to use the iFrame call but the Ajax call but I was getting a 404 Error. After looking at the URL Ajax was calling I noticed the Ampersand symbol (&) was being passed in the URL but the .action method needs a ? to pass parms in the URL.

Looking at thickbox.js line (303 I think)

[CODE]url += "&random=" + (new Date().getTime()), function() {[/CODE]

I just replaced the & with ? and bingo.

[CODE]url += "?random=" + (new Date().getTime()), function() {[/CODE]

Just a FYI for all with headaches ;-)