String manipulation functions
347
Dreamweaver calls the seven callback functions on the following occasions:
1.
Dreamweaver calls
openTagBegin()
for each opening tag (for example,
<font>
, as
opposed to
</font>
) and each empty tag (for example,
<img>
or
<hr>
). The
openTagBegin()
function accepts two arguments: the name of the tag (for example,
"font"
or
"img"
) and the document offset, which is the number of bytes in the document
before the beginning of the tag. The function returns
true
if scanning should continue or
false
if it should stop.
2.
After
openTagBegin()
executes, Dreamweaver calls
attribute()
for each HTML
attribute. The
attribute()
function accepts two arguments, a string that contains the
attribute name (for example,
"color"
or
"src"
) and a string that contains the attribute
value (for example,
"#000000"
or
"foo.gif"
). The
attribute()
function returns a
Boolean value that indicates whether scanning should continue.
3.
After all the attributes in the tag have been scanned, Dreamweaver calls
openTagEnd()
.
The
openTagEnd()
function accepts one argument, the document offset, which is the
number of bytes in the document before the end of the opening tag. It returns a Boolean
value that indicates whether scanning should continue.
4.
Dreamweaver calls
closeTagBegin()
for each closing tag (for example,
</font>
). The
function accepts two arguments, the name of the tag to close (for example,
"font"
) and
the document offset, which is the number of bytes in the document before the beginning
of the closing tag. The function returns a Boolean value that indicates whether scanning
should continue.
5.
After
closeTagBegin()
returns, Dreamweaver calls the
closeTagEnd()
function. The
closeTagEnd()
function accepts one argument, the document offset, which is the number
of bytes in the document before the end of the closing tag. It returns a Boolean value that
indicates whether scanning should continue.
6.
Dreamweaver calls the
directive()
function for each HTML comment, ASP script, JSP
script, or PHP script. The
directive()
function accepts two arguments, a string that
contains the directive and the document offset, which is the number of bytes in the
document before the end of the closing tag. The function returns a Boolean value that
indicates whether scanning should continue.
7.
Dreamweaver calls the
text()
function for each span of text in the document (that is,
everything that is not a tag or a directive). Text spans include text that is not visible to the
user, such as the text inside a
<title>
or
<option>
tag. The
text()
function accepts two
arguments, a string that contains the text and the document offset, which is the number of
bytes in the document before the closing of the closing tag. The
text()
function returns
a Boolean value that indicates whether scanning should continue.
000_DW_API_Print.book Page 347 Wednesday, July 20, 2005 11:58 AM
Summary of Contents for DREAMWEAVER 8-DREAMWEAVER API
Page 1: ...Dreamweaver API Reference...
Page 16: ......
Page 28: ...28 The File I O API...
Page 38: ...38 The HTTP API...
Page 68: ...68 Flash Integration...
Page 100: ...100 The Database API...
Page 116: ...116 The JavaBeans API...
Page 144: ...144 The Source Control Integration API...
Page 146: ......
Page 254: ...254 Workspace...
Page 298: ...298 Site...
Page 354: ...354 Document...
Page 396: ...396 Page Content...
Page 488: ...488 Design...
Page 550: ...550 Code...