MACROMEDIA DREAMWEAVER MX 2004-EXTENDING DREAMWEAVER Especificaciones Pagina 319

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 504
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 318
The Behaviors API 319
inspectBehavior()
Description
This function inspects the function call for a previously applied behavior in the user’s
document and sets the values of the options in the Parameters dialog box accordingly. If the
inspectBehavior() function is not defined, the default option values appear.
Arguments
applyBehaviorString
This argument is the string that the applyBehavior() function returns.
function inspectBehavior(enteredStr){
if(enteredStr){
//do your work here
}
}
Returns
Dreamweaver expects nothing.
Example
The following instance of the inspectBehavior() function, taken from the Display Status
Message.htm file, fills in the Message field in the Parameters dialog box with the message that
the user selected when the behavior was originally applied:
function inspectBehavior(msgStr){
var startStr = msgStr.indexOf("'") + 1;
var endStr = msgStr.lastIndexOf("'");
if (startStr > 0 && endStr > startStr) {
document.theForm.message.value = ¬
unescQuotes(msgStr.substring(startStr,endStr));
}
}
NOTE
The inspectBehavior() function must rely solely on information that the
applyBehaviorString argument passes to it. Do not attempt to obtain other
information about the user’s document (for example, using
dreamweaver.getDocumentDOM()) within this function.
NOTE
If the HTML element contains code that is similar to 'onClick="someBehavior();
return document.MM_returnValue;"', and you add a new behavior from the behavior
menu, Dreamweaver calls inspectBehavior() as soon as the new behavior UI pops up,
and passes an empty string as the parameter. Consequently, be sure to check the
applyBehaviorString parameter, as shown in the following example:
Vista de pagina 318
1 2 ... 314 315 316 317 318 319 320 321 322 323 324 ... 503 504

Comentarios a estos manuales

Sin comentarios