
123
EXTENDING DREAMWEAVER CS4
Insert bar objects
objectTag()
Description
The objectTag() and insertObject() functions are mutually exclusive: If both are defined in a document, the
objectTag() function is used. For more information, see “insertObject()” on page 122.
This function inserts a string of code into the user’s document. Returning an empty string, or a null value (also known
as "
return"), is a signal to Dreamweaver to do nothing.
Note: The assumption is that edits have been made manually before the return statement, so doing nothing in this case
is not equivalent to clicking Cancel.
In Dreamweaver, if the focus is in Code view and the selection is a range (meaning that it is not an insertion point),
the range is replaced by the string that the
objectTag() function returns. This is the value true, even if the
objectTag() function returns an empty string or returns nothing. The objectTag() function returns an empty
string or a
null value because edits to the document have already been made manually. Otherwise, double quotation
marks (" ") often delete the edit by replacing the selection.
Arguments
None.
Returns
Dreamweaver expects the string to insert into the user’s document.
Example
The following example of the objectTag() function inserts an OBJECT/EMBED combination for a specific ActiveX
control and plug-in:
function objectTag() {
return '\n' +
'<OBJECT CLASSID="clsid:166F1OOB-3A9R-11FB-8075444553540000" \n'¬
+ 'CODEBASE="http://www.mysite.com/product/cabs/¬
myproduct.cab#version=1,0,0,0" \n' + 'NAME="MyProductName"> \n' ¬
+ '<PARAM NAME="SRC" VALUE=""> \n' + '<EMBED SRC="" HEIGHT="" ¬
WIDTH="" NAME="MyProductName"> \n' + '</OBJECT>'
}
windowDimensions()
Description
This function sets specific dimensions for the Options dialog box. If this function is not defined, the window
dimensions are computed automatically.
Note: Do not define this function unless you want an Options dialog box that is larger than 640 x 480 pixels.
Arguments
platform
• The value of the platform argument is either "macintosh" or "windows", depending on the user’s platform.
Komentarze do niniejszej Instrukcji