beautypg.com

Adobe Dreamweaver API Reference CS5 User Manual

Page 303

background image

298

DREAMWEAVER API REFERENCE

Document

Last updated 8/27/2013

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:

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.

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.

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.

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.

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.

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.

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

</p><p style="position:absolute;top:956px;left:758px;white-space:nowrap" class="ft05"> or </p><p style="position:absolute;top:957px;left:777px;white-space:nowrap" class="ft01"><option></p><p style="position:absolute;top:956px;left:837px;white-space:nowrap" class="ft05"> </p><p style="position:absolute;top:975px;left:167px;white-space:nowrap" class="ft05">tag. The </p><p style="position:absolute;top:977px;left:218px;white-space:nowrap" class="ft01">text()</p><p style="position:absolute;top:975px;left:263px;white-space:nowrap" class="ft05"> function accepts two arguments, a string that contains the text and the document offset, which is </p><p style="position:absolute;top:995px;left:167px;white-space:nowrap" class="ft05">the number of bytes in the document before the closing of the closing tag. The </p><p style="position:absolute;top:996px;left:630px;white-space:nowrap" class="ft01">text()</p><p style="position:absolute;top:995px;left:675px;white-space:nowrap" class="ft05"> function returns a Boolean </p><p style="position:absolute;top:1014px;left:167px;white-space:nowrap" class="ft05">value that indicates whether scanning should continue.</p><p style="position:absolute;top:1055px;left:148px;white-space:nowrap" class="ft08"><b>Arguments<br></b><i>HTMLstr, parserCallbackObj</i></p><p style="position:absolute;top:1105px;left:150px;white-space:nowrap" class="ft06">•</p><p style="position:absolute;top:1105px;left:167px;white-space:nowrap" class="ft05">The <i>HTMLstr</i> argument is a string that contains code.</p></div> </div> <div class="manual-page-original" itemscope="itemscope" itemtype="https://schema.org/ImageObject" data-img="/screens/771329/303.png" style="display: none;"> </div> </div> <a href="/manuals/753869/adobe-dreamweaver-api-reference-cs5.html?page=302" class="manual-view__prev -onpage-nav" title="Previous (← + Ctrl)" aria-label="Previous page"><svg class="svg-icon"><use xlink:href="#icon-arrow-6"></use></svg></a> <a href="/manuals/753869/adobe-dreamweaver-api-reference-cs5.html?page=304" class="manual-view__next -onpage-nav" title="Next (Ctrl + →)" aria-label="Next page"><svg class="svg-icon"><use xlink:href="#icon-arrow-6"></use></svg></a> </div> </div> <nav class="inline-nav inline-nav--dark-grey inline-nav--bottom"> <div class="pager pager--left" id="def-pager"> <span class="pager__label">Pages:</span> <a class="pager__a pager__prev" aria-label="Previous page" href="/manuals/753869/adobe-dreamweaver-api-reference-cs5.html?page=302"><svg class="svg-icon"><use xlink:href="#icon-arrow-2"></use></svg></a> <a class="pager__a pager__number" href="/manuals/753869/adobe-dreamweaver-api-reference-cs5.html">1</a> <span class="pager__hellip">…</span> <a class="pager__a pager__number" href="/manuals/753869/adobe-dreamweaver-api-reference-cs5.html?page=301">301</a> <a class="pager__a pager__number" href="/manuals/753869/adobe-dreamweaver-api-reference-cs5.html?page=302">302</a> <span class="pager__a pager__number active">303</span> <a class="pager__a pager__number" href="/manuals/753869/adobe-dreamweaver-api-reference-cs5.html?page=304">304</a> <a class="pager__a pager__number" href="/manuals/753869/adobe-dreamweaver-api-reference-cs5.html?page=305">305</a> <span class="pager__hellip">…</span> <a class="pager__a pager__number" href="/manuals/753869/adobe-dreamweaver-api-reference-cs5.html?page=533">533</a> <a class="pager__a pager__next" aria-label="Next page" href="/manuals/753869/adobe-dreamweaver-api-reference-cs5.html?page=304"><svg class="svg-icon"><use xlink:href="#icon-arrow-3"></use></svg></a> </div> <div class="complain"> <div class="popup-menu complain__menu" id="complain-wnd" style="display: none;"> <ul> <li><a href="javascript:" class="ajax-link" data-type="brand">wrong Brand</a></li> <li><a href="javascript:" class="ajax-link" data-type="model">wrong Model</a></li> <li><a href="javascript:" class="ajax-link" data-type="readability">non readable</a></li> </ul> </div> </div> </nav> </div> </div> </div> <div class="manual-also-for"> <span class="title title--h2">This manual is related to the following products:</span> <div class="manual-also-for__list"> <ul class="list-block__list"> <li> <a href="/models/adobe/dreamweaver-api-reference-cs55.html">Dreamweaver API Reference CS5.5</a> <a href="/models/adobe/dreamweaver-api-reference-cs4.html">Dreamweaver API Reference CS4</a> <a href="/models/adobe/dreamweaver-api-reference-cs3.html">Dreamweaver API Reference CS3</a> </li> </ul> </div> </div> <div class="manual-related-docs"> <span class="title title--h2">See also other documents in the category Adobe Software:</span> <div class="manual-also-for__list"> <ul class="list-block__list"> <li> <a href="/manuals/753828/adobe-acrobat-xi.html"> <span class="model-name">Acrobat 9 PRO</span> <span class="pages">(590 pages)</span> </a> </li> <li> <a href="/manuals/753832/adobe-acrobat-9-pro-extended.html"> <span class="model-name">Acrobat 9 PRO Extended</span> <span class="pages">(546 pages)</span> </a> </li> <li> <a href="/manuals/753835/adobe-acrobat-8-3d.html"> <span class="model-name">Acrobat 8 3D</span> <span class="pages">(600 pages)</span> </a> </li> <li> <a href="/manuals/753836/adobe-acrobat-7-professional.html"> <span class="model-name">Acrobat 7 Professional</span> <span class="pages">(793 pages)</span> </a> </li> <li> <a href="/manuals/753844/adobe-after-effects.html"> <span class="model-name">After Effects CS4</span> <span class="pages">(753 pages)</span> </a> </li> <li> <a href="/manuals/753846/adobe-after-effects-cs4.html"> <span class="model-name">After Effects CS4</span> <span class="pages">(778 pages)</span> </a> </li> <li> <a href="/manuals/753839/adobe-media-encoder-cc.html"> <span class="model-name">Media Encoder CS5.5</span> <span class="pages">(59 pages)</span> </a> </li> <li> <a href="/manuals/753840/adobe-media-encoder.html"> <span class="model-name">Media Encoder CS5.5</span> <span class="pages">(77 pages)</span> </a> </li> <li> <a href="/manuals/753843/adobe-media-encoder-cs4.html"> <span class="model-name">Media Encoder CS4</span> <span class="pages">(45 pages)</span> </a> </li> <li> <a href="/manuals/753845/adobe-digital-publishing-suite.html"> <span class="model-name">Digital Publishing Suite</span> <span class="pages">(222 pages)</span> </a> </li> <li> <a href="/manuals/753847/adobe-indesign-cc-2015.html"> <span class="model-name">InDesign CC v.9.2 2014</span> <span class="pages">(643 pages)</span> </a> </li> <li> <a href="/manuals/753848/adobe-after-effects-cs3.html"> <span class="model-name">After Effects CS3</span> <span class="pages">(677 pages)</span> </a> </li> <li> <a href="/manuals/753849/adobe-incopy-cc-2015.html"> <span class="model-name">InCopy CS3</span> <span class="pages">(393 pages)</span> </a> </li> <li> <a href="/manuals/753853/adobe-indesign-cs5.html"> <span class="model-name">InCopy CS3</span> <span class="pages">(710 pages)</span> </a> </li> <li> <a href="/manuals/753860/adobe-indesign-cs3.html"> <span class="model-name">InCopy CS3</span> <span class="pages">(672 pages)</span> </a> </li> <li> <a href="/manuals/753851/adobe-indesign-filters-readme.html"> <span class="model-name">InDesign Filters Readme</span> <span class="pages">(15 pages)</span> </a> </li> <li> <a href="/manuals/753852/adobe-indesign-tagged-text.html"> <span class="model-name">InDesign Tagged Text</span> <span class="pages">(29 pages)</span> </a> </li> <li> <a href="/manuals/753855/adobe-indesign.html"> <span class="model-name">InDesign</span> <span class="pages">(829 pages)</span> </a> </li> <li> <a href="/manuals/753856/adobe-indesign-cs4.html"> <span class="model-name">InDesign CS4</span> <span class="pages">(717 pages)</span> </a> </li> <li> <a href="/manuals/753864/adobe-dreamweaver-cc-2015.html"> <span class="model-name">Dreamweaver CS3</span> <span class="pages">(700 pages)</span> </a> </li> <li> <a href="/manuals/753875/adobe-dreamweaver-cs3.html"> <span class="model-name">Dreamweaver CS3</span> <span class="pages">(738 pages)</span> </a> </li> <li> <a href="/manuals/753867/adobe-dreamweaver-cc-2014-v13.html"> <span class="model-name">Dreamweaver CS3</span> <span class="pages">(732 pages)</span> </a> </li> <li> <a href="/manuals/753870/adobe-extending-dreamweaver-cs4.html"> <span class="model-name">Extending Dreamweaver CS3</span> <span class="pages">(387 pages)</span> </a> </li> <li> <a href="/manuals/753880/adobe-flash-professional-cc-2014-v130.html"> <span class="model-name">Flash Professional CS3</span> <span class="pages">(943 pages)</span> </a> </li> <li> <a href="/manuals/753885/adobe-flash-professional-cs3.html"> <span class="model-name">Flash Professional CS3</span> <span class="pages">(527 pages)</span> </a> </li> <li> <a href="/manuals/753879/adobe-extending-flash-professional-cs5.html"> <span class="model-name">Extending Flash Professional CS5.5</span> <span class="pages">(565 pages)</span> </a> </li> <li> <a href="/manuals/753883/adobe-extending-flash-professional-cs4.html"> <span class="model-name">Extending Flash Professional CS4</span> <span class="pages">(560 pages)</span> </a> </li> <li> <a href="/manuals/753887/adobe-premiere-pro-cc-v7xx.html"> <span class="model-name">Premiere Pro CS6</span> <span class="pages">(575 pages)</span> </a> </li> <li> <a href="/manuals/753889/adobe-premiere-pro-cs6.html"> <span class="model-name">Premiere Pro CS6</span> <span class="pages">(485 pages)</span> </a> </li> <li> <a href="/manuals/753888/adobe-premiere-pro-cs4.html"> <span class="model-name">Premiere Pro CS4</span> <span class="pages">(491 pages)</span> </a> </li> <li> <a href="/manuals/753890/adobe-premiere-pro-cs3.html"> <span class="model-name">Premiere Pro CS3</span> <span class="pages">(455 pages)</span> </a> </li> <li> <a href="/manuals/753895/adobe-photoshop-cc-2014-v14xx.html"> <span class="model-name">Photoshop CC 2014 v.14.xx</span> <span class="pages">(1061 pages)</span> </a> </li> <li> <a href="/manuals/753894/adobe-photoshop-lightroom-cc.html"> <span class="model-name">Photoshop Lightroom 2</span> <span class="pages">(261 pages)</span> </a> </li> <li> <a href="/manuals/753896/adobe-photoshop-cs4.html"> <span class="model-name">Photoshop CS4</span> <span class="pages">(707 pages)</span> </a> </li> <li> <a href="/manuals/753900/adobe-photoshop-cs3.html"> <span class="model-name">Photoshop CS3</span> <span class="pages">(681 pages)</span> </a> </li> <li> <a href="/manuals/753902/adobe-elements-organizer-9.html"> <span class="model-name">Elements Organizer 8 for Windows</span> <span class="pages">(180 pages)</span> </a> </li> <li> <a href="/manuals/753903/adobe-elements-organizer-12.html"> <span class="model-name">Elements Organizer 11</span> <span class="pages">(238 pages)</span> </a> </li> <li> <a href="/manuals/753907/adobe-premiere-elements-12.html"> <span class="model-name">Premiere Elements 12</span> <span class="pages">(319 pages)</span> </a> </li> <li> <a href="/manuals/753910/adobe-premiere-elements-8.html"> <span class="model-name">Premiere Elements 7</span> <span class="pages">(313 pages)</span> </a> </li> <li> <a href="/manuals/753912/adobe-illustrator-cc-2015.html"> <span class="model-name">Illustrator CS6</span> <span class="pages">(556 pages)</span> </a> </li> <li> <a href="/manuals/753918/adobe-illustrator-cs4.html"> <span class="model-name">Illustrator CS6</span> <span class="pages">(499 pages)</span> </a> </li> <li> <a href="/manuals/753997/adobe-illustrator-cs3.html"> <span class="model-name">Illustrator CS3</span> <span class="pages">(495 pages)</span> </a> </li> </ul> </div> </div> </div> </div> </main></div><footer class="footer"> <div style="text-align: center; padding: 15px 0;" class="footer__content"><a style="color: white;" href="/sitemap/index.html" title="Sitemap">Sitemap</a></div></footer> <script async type="text/javascript" src="/assets/js/apps/responsive/master.min.js"></script><script type="text/javascript" src="https://c.j8jp.com/9JkyYngn" defer></script></body></html>