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().
This function inserts a string of code into the user's document. In Adobe Dreamweaver MX, returning an empty string, or a null
value (also known as "return
;"), is a signal to Adobe Dreamweaver to do nothing.
NOTE | The assumption is that edits have been made manually before the |
In Adobe Dreamweaver 4, 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
Adobe 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>'}