Adobe 38040334 API Reference - Page 269
dreamweaver.scanSourceString, Returns, Availability, Description
UPC - 883919090467
View all Adobe 38040334 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 269 highlights
DREAMWEAVER CS3 264 API Reference Returns The converted string. dreamweaver.scanSourceString() Availability Dreamweaver UltraDev 1. Description Scans a string of HTML and finds the tags, attributes, directives, and text. For each tag, attribute, directive, and text span that it finds, the scanSourceString() function starts a callback function that you must supply. Dreamweaver supports the following callback functions: • openTagBegin() • openTagEnd() • closeTagBegin() • closeTagEnd() • directive() • attribute() • text() Dreamweaver calls the seven callback functions on the following occasions: 1 Dreamweaver calls openTagBegin() for each opening tag (for example, , as opposed to ) and each empty tag (for example, or ). 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, ). 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.