Hi there,

I'm trying to edit thickbox to call a default function whenever a
iframe has loaded, the function will not always exist in the page
loaded so I would not want a JS-error when this is the case.
Code I'm using atm:

.                  try  {
line 304:             setTimeout("frames['TB_iframeContent'].TB_loaded()", 100);
.                  }
.       catch (e){alert(e)}

the alert here is just for my debugging, and would be removed when I'm
finished with the testing.

Anyway, when the function exists it only gets properly executed once,
if for instance I have a login form that opens in a thickbox, and I
close it only to open it again, the second time I get this error:

frames.TB_iframeContent.TB_loaded is not a function
http://localhost/haddock/js/thickbox.js
Line 304

This is a but puzzling, thickbox RELOADS the content to be put in the
iframe right? Then why could it matter if it's the first or second
time it has been loaded?

Oh and anyone have a good way of checking if the function exists to
avoid any error messages when it doesnt?

Thx in advance guys

_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to