I have a span tag as parent to an object tag that loads a Java class. The span tag has style display:none. When a reference to the object tag is retrieved in Javascript and a method of this object tag is called, it fails.
But, if the span tag does not have display:none set OR visibility:hidden, then it works.
Why is this?
<span style='display:none'>
<object type="application/x-java-applet" width="100" height="100" name="my_class" id="my_class">
<param name="codebase" value="http://www.whatever.com/class">
<param name="code" value="myclass.class">
<param name="mayscript" value="yes">
<param name="scriptable" value="true">
</object>
</span>
This is basic styles (CSS), a hidden object is still included in the page, while an element with
display:noneis not even included.Solution:
10x10pixels in sizevisibility:hiddento hide it from view. Note that isvisibility, notdisplay!