MACROMEDIA DREAMWEAVER MX 2004-EXTENDING DREAMWEAVER Specifikace Strana 106

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 504
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 105
106 Extending Dreamweaver
How Dreamweaver processes JavaScript in
extensions
Dreamweaver checks the Configuration/extension_type folder during startup. If it encounters
an extension file within the folder, Dreamweaver processes the JavaScript by completing the
following steps:
Compiling everything between the beginning and ending SCRIPT tags
Executing any code within SCRIPT tags that is not part of a function declaration
Dreamweaver performs the following actions for any external JavaScript files that are specified
in the
SRC attributes of SCRIPT tags:
Reads in the file
Compiles the code
Executes the procedures
Dreamweaver executes code in the
onLoad event handler (if one appears in the BODY tag)
when the user selects the command or action from a menu for the Command and Behavior
action extension types.
Dreamweaver executes code in the
onLoad event handler on the BODY tag if the body of the
document contains a form for object extensions.
Dreamweaver ignores the
onLoad handler on the BODY tag in the following extensions:
Data translator
Property inspector
Floating panel
For all extensions, Dreamweaver executes code in other event handlers (for example,
onBlur="alert('This is a required field.')") when the user interacts with the form
fields to which they are attached.
NOTE
This procedure is necessary during startup because some extensions might require
global variables to initialize.
NOTE
If any JavaScript code in your extension file contains the string “</SCRIPT>”, the
JavaScript interpreter reads the string as an ending
SCRIPT tag and reports an
unterminated string literal error. To avoid this problem, break the string into pieces
and concatenate them like this:
"<' + '/SCRIPT>".
Zobrazit stránku 105
1 2 ... 101 102 103 104 105 106 107 108 109 110 111 ... 503 504

Komentáře k této Příručce

Žádné komentáře