MACROMEDIA DREAMWEAVER MX 2004-EXTENDING DREAMWEAVER Dokumentacja Strona 275

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 504
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 274
Tag editor APIs 275
The cfweather tag appears in the list box on the right.
Select cfweather, and click the Insert button.
The tag editor should appear.
Tag editor APIs
In order to create a new tag editor, you must provide an implementation for the
inspectTag(), validateTag(), and applyTag() functions. For an example of an
implementation, see “Creating a tag editor UI” on page 272.
inspectTag()
Availability
Dreamweaver MX.
Description
The function is called when the tag editor first appears. The function receives as an argument
the tag that the user is editing, which is expressed as a
dom object. The function extracts
attribute values from the tag that is being edited and uses these values to initialize form
elements in the tag editor.
Arguments
tag
The tag argument is the DOM node of the edited tag.
Returns
Dreamweaver expects nothing.
Example
Suppose the user edits the following tag:
<crfweather zip = “94065”/>
If the editor contains a text field for editing the zip attribute, the function needs to initialize
the form element so that the user sees the actual ZIP code in the text field, rather than an
empty field.
The following code performs the initialization:
function inspectTag(tag)
{
document.forms[0].zip.value = tag.zip
}
Przeglądanie stron 274
1 2 ... 270 271 272 273 274 275 276 277 278 279 280 ... 503 504

Komentarze do niniejszej Instrukcji

Brak uwag