The Objects Api Functions - Adobe 38040334 - Dreamweaver CS3 User Manual

Extending dreamweaver
Hide thumbs Also See for 38040334 - Dreamweaver CS3:
Table of Contents

Advertisement

To test the new pop-up menu:
1
Reload extensions. For information on reloading extensions, see "Reloading extensions" on page 74.
Click the Editorial menu.
2
The following pop-up menu appears:

The objects API functions

This section describes the functions in the objects API. You must define either the
function. For details about these functions, see "insertObject()" on page 117. The remaining functions
objectTag()
are optional.
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;}
DREAMWEAVER CS3
Extending Dreamweaver
or the
insertObject()
116

Advertisement

Table of Contents
loading

This manual is also suitable for:

Dreamweaver cs3

Table of Contents