Macromedia dreamweaver 8-extending dreamweaver 사용자 설명서

다운로드
페이지 504
312
Behaviors
<body 
onLoad="checkBrowserBrand('netscaptecontent.htm','iecontent.htm')">
</body>
</html>
Testing the behavior
Finally, you can test the behavior.
To test the behavior:
1.
View the file whichbrowser.htm in your browser.
Depending on which browser you are using, either iecontent.htm or netscapecontent.htm 
appears.
The Behaviors API
Two Behaviors API functions are required (
applyBehavior()
 and 
behaviorFunction()
); 
the rest are optional. 
applyBehavior()
Description
This function inserts into the user’s document an event handler that calls the function that the 
behaviorFunction()
 function inserts. The 
applyBehavior()
 function can also perform 
other edits on the user’s document, but it must not delete the object to which the behavior is 
being applied or the object that receives the action.
Arguments
uniqueName
The argument is a unique identifier among all instances of all behaviors in the user’s 
document. Its format is 
functionNameInteger
, where 
functionName
 is the name of the 
function that 
behaviorFunction() 
inserts. This argument is useful if you insert a tag 
into the user’s document and you want to assign a unique value to its 
NAME
 attribute.