canInsertObject()

Availability

Adobe Dreamweaver MX.

Description

This function determines whether to display the Object dialog box.

Arguments

None.

Returns

Adobe Dreamweaver expects a Boolean value.

Example

The following code tells Adobe Dreamweaver to check to see that the document contains a particular string before allowing the user to insert the selected object:

function canInsertObject(){  var docStr = dw.getDocumentDOM().documentElement.outerHTML; var patt = /hava/; var found = ( docStr.search(patt) != -1 ); var insertionIsValid = true;   if (!found){ insertionIsValid = false; alert("the document must contain a 'hava' string to use this object.");} return insertionIsValid;}