Click to See Complete Forum and Search --> : JavaScript and OBJECT tag


simkoe
07-05-2004, 11:36 AM
Hi,

In Mozilla/FireFox, if I have the following construct:

<object classid="clsid:abc..." id="object1" width="100%" height="400">
<textarea name="alternate1" id="alternate1" cols="60" rows="15"></textarea>
</object>


How can I determine using JavaScript if the object or the textrea is being rendered by the browser? The following works in IE but not in Mozilla/FireFox.

if (document.getElementById('object1') && document.getElementById('object1') != null) {
alert('object is rendered');
} else {
alert('textarea is rendered');
}


Thanks.

olaf
07-05-2004, 03:36 PM
maybe there limits to the object tag can you use a diff. tag?

David Harrison
07-05-2004, 05:16 PM
Any browser that doesn't support the object tag will be very old. Don't even bother trying to cater for such old browsers any more, there's no point. Just make sure that the page looks OK without JavaScript.