Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Q1148 Is it possible to detect for the support of object methods in the same way you can detect for the support of objects?

irt.org | Knowledge Base | JavaScript | Object | Q1148 [ previous next ]

Q1148 Is it possible to detect for the support of object methods in the same way you can detect for the support of objects?

It would be nice if you could. But IIRC it can't be done on Internet Explorer 3 - it doesn't like you testing for object methods that actually exist. The following code shows how you would test for objects, methods and properties:

<script language="JavaScript"><!--
if (document.images)
    document.write('Image object supported<br>');
else
    document.write('Image object is not supported<br>');

if (window.open)
    document.write('Window open method supported<br>');
else
    document.write('Window open method not supported<br>');

if (window.location)
    document.write('Window location propert supported<br>');
else
    document.write('Window location propert not supported<br>');

if (window.bogusname)
    document.write('Window bogusname object/method/property supported<br>');
else
    document.write('Window bogusname object/method/property not supported<br>');
//--></script>

Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.