typeof on applet method suddelny stopped working...

D

Dag Sunde

I have the following code fragment in one of my pages:

if (typeof document.getElementById('myApplet').getTableAsSDV != 'undefined')
{
rowBuffer = document.getElementById('myApplet').getTableAsSDV();
}

The code above have been working in IE, NS anf Firefox for a long time now,
but have suddenly stopped working in IE 6, on WIN XP SP1.

It now returns 'undefined', so my rowbuffer never get set.

For the record:
typeof document.getElementById('myApplet') returns 'object',
so the applet is found.

It still work on other browsers, and in IE on Win2000 and lower...

Any insights on thisone?

TIA...
 
M

Martin Honnen

Dag said:
I have the following code fragment in one of my pages:

if (typeof document.getElementById('myApplet').getTableAsSDV != 'undefined')
{
rowBuffer = document.getElementById('myApplet').getTableAsSDV();
}

The code above have been working in IE, NS anf Firefox for a long time now,
but have suddenly stopped working in IE 6, on WIN XP SP1.

It now returns 'undefined', so my rowbuffer never get set.

For the record:
typeof document.getElementById('myApplet') returns 'object',
so the applet is found.

If you have
<object id="myApplet" ...>
or
<applet id="myApplet" ...>
then of course
document.getElementById('myApplet')
finds that element object but whether the applet is run and exposes
public properties is a different issue.
Is Java enabled at all, have you checked the Java console whether there
are any problems with the applet itself being properly initialized and
started?
 
D

Dag Sunde

Martin Honnen said:
If you have
<object id="myApplet" ...>
or
<applet id="myApplet" ...>
then of course
document.getElementById('myApplet')
finds that element object but whether the applet is run and exposes
public properties is a different issue.
Is Java enabled at all, have you checked the Java console whether there
are any problems with the applet itself being properly initialized and
started?

Yes to all of the above...
The applet is alive & kickin' when the problem occurs...
No problems in the console...
Java is definitely enabled (Sun plugin 1.4.2_06)

The above test was to check if my applet actually had a method called
"getTableAsSDV()" before calling it, but that suddenly stopped working
in IE/XP.

I've changed the code to:
if ( document.getElementById('myApplet') ) {
document.getElementById('myApplet').getTableAsSDV();
}
instead, and all is well... (but it puzzles me...)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top