SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 1921 | Next

Joseph W. Lowery

"Dreamweaver CS3 Bible"


Naming objects and AP elements is often critical in JavaScript, as it certainly is with
getElementRef() and getObjectRefs(). Dreamweaver can??™t return references for
unnamed objects; instead, it gives you an ???unnamed ??? message. Furthermore, Dreamweaver can??™t
handle references to a named object if it is in an unnamed AP element or form. To help with the naming task,
Dreamweaver automatically assigns a name attribute to forms and an ID attribute to AP elements as they
are created.
CAUTION CAUTION
BC 44
Creating a Behavior
The dreamweaver.getBehaviorTag() function
The getBehaviorTag() function returns the tag selected to implement the current behavior. The
getBehaviorTag() function can also be incorporated into the behavior setup code to steer the user in
the appropriate direction.
The getBehaviorTag() function returns the entire tag??”name, attributes, values, and any text selected??”
exactly as it is written (capitalization, spaces, and so on). In most situations, you need only the relevant portion
of the tag, its name (img), for example. You can find the relevant portion of a tag by using JavaScript??™s
indexOf() method to search a string (the entire tag) for a specified substring. The following code looks to
see if the tag selected for the behavior is an tag.


Pages:
1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933