canInspectSelection()

Description

Determines whether the Property inspector is appropriate for the current selection.

Arguments

None.

NOTE

Use dom.getSelectedNode() to get the current selection as a JavaScript object (for more information about dom.getSelectedNode(), see the Adobe Dreamweaver API Reference).

Returns

Adobe Dreamweaver expects a Boolean value: true if the inspector can inspect the current selection; false otherwise.

Example

The following instance of the canInspectSelection() function returns a true value if the selection contains the CLASSID attribute, and the value of that attribute is "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" (the class ID for Adobe Flash Player):

function canInspectSelection(){ var theDOM = dw.getDocumentDOM(); var theObj = theDOM.getSelectedNode(); return (theObj.nodeType == Node.ELEMENT_NODE && ¬  theObj.hasAttribute("classid") && ¬ theObj.getAttribute("classid").toLowerCase()== ¬ "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000");}