I’m beating my head against strange issue using a combination of a java applet running in an iframe displayed inside a lightbox on Firefox.
When the page is displayed directly an javascript call to the applet
document.appletname.send
Functions perfectly, however when called from inside a lighbox (actually lightwindow) then the error is returned
Error: document.appletname.send is not a function
This only occurs on Firefox in Windows. IE, Safari and Chrome are fine, as is Firefox on Ubuntu
For information the applet is a Wirefusion 3D presentation and you can see the applet running via the lightbox box by clicking on Highland Laddie 3D at the bottom of the page, or directly in the page containing the lightbox.
I’ve tried adding javascript diagnostic code to check that the applet exists and has the correct name (it does). The only odd thing I can see is that with Firefox the applet appears to start loading twice.
ADDED: In response to a question. The page being called in the lightbox is very simple, just this
<div style="position:absolute; top:0px; left:0px">
<iframe id="mainframe"
src="http://www.tartanweb.com/laddie/highlandladdie.php" width="730px" height="670px" scrolling="no">
<p>Your browser does not support iframes.</p>
</iframe>
</div>
<div style="position:absolute; top:15px; left:600px; z-index:1; width:30px;" >
<a href="blank-width.html" class="lightwindow_action" rel="deactivate"><input type="button" value="Close"></a>
</div>
So just the iframe itself and a close button. The javascript code giving the trouble is the page called by the iframe. I added javascript code in the iframe to check and it reports just one applet in the page – so the applet can’t be being loaded twice inside the page it’s embedded in.
Lightbox and clones sometimes cause trouble because they move (or in the worst event, copy) DOM elements out of their context into the Lightbox container. That might account for the IFRAME being loaded twice.
If the applet were not in an IFRAME, I would guess that the Lightbox duplicates the applet, and all subsequent calls to
document.appletnamemust fail. However, if the Java Applet is embedded in an IFRAME, I can’t see how that could happen. Are you maybe referencing the Applet from outside the IFrame? Can you show the referencing code?