The Objects API
This section describes the functions in the Objects API. You must define either the
insertObject()
"insertObject()" on page
canInsertObject()
Availability
Dreamweaver MX.
Description
This function determines whether to display the Object dialog box.
Arguments
None.
Returns
Dreamweaver expects a Boolean value.
Example
The following code tells 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;}
displayHelp()
Description
If you define this function, it displays a Help button below the OK and Cancel buttons in the
Parameters dialog box. This function is called when the user clicks the Help button.
Arguments
None.
Returns
Dreamweaver expects nothing.
122
Chapter 6: Insert Bar Objects
or the
function. For details about these functions, see
objectTag()
123. The remaining functions are optional.
Need help?
Do you have a question about the DREAMWEAVER MX 2004-EXTENDING DREAMWEAVER and is the answer not in the manual?
Questions and answers