ThickBox, IE6 and a little secure and nonsecure item problem

So it’s been a fun packed morning looking at an issue within ie6 that was causing the “This page contains both secure and nonsecure items” prompt to be displayed then viewing a page over HTTPS.

The problem itself only reared its ugly head when the page tried to open a UI dialog to the user using the “ThickBox” add-on to jquery. So after a bit of digging around I found out that IE6 shows this message because “ThickBox” is adding an iframe to the page without the src attribute set. In order to fix the issue then all you need to do is add a dummy src attribute to the iframe when it is appended to the page by “ThickBox”. See the example below.  The bit of code you need to update can be found on line 38 within the thickbox.js file.

Original Code

 $("body").append("<iframe id='TB_HideSelect'></iframe><div id='TB_overlay'></div><div id='TB_window'></div>");

Updated Code

$("body").append("<iframe id='TB_HideSelect' src='java script:false;'></iframe><div id='TB_overlay'></div><div id='TB_window'></div>");

November 6 2008
blog comments powered by Disqus