MACROMEDIA DREAMWEAVER MX 2004-EXTENDING DREAMWEAVER Spezifikationen Seite 443

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 504
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 442
A simple attribute translator example 443
6. Add alert() statements in strategic spots throughout the translateMarkup() function
so you can make sure you’re getting the proper branches and so you can check the values
of variables and properties at different points:
for (var i=0; i< foo.length; i++){
alert("we're at the top of foo.length array, and the value ¬
of i is " + i);
/* rest of loop */
}
7.
After adding the alert() statements, select your command from the Commands menu,
click Cancel, and select it again. This process reloads the command file and incorporates
your changes.
A simple attribute translator example
To better understand attribute translation, it’s helpful to look at an example. The following
translator is Pound Conditional (Poco) markup, a syntax thats somewhat similar to ASP or
PHP.
You create the attribute translator by performing the following steps:
Creating the tagspec tag
Creating the icon
Creating the attribute translator
Creating the tagspec tag
The first step in making this translator work properly is to create a tagspec tag for Poco
markup, which prevents Dreamweaver from parsing the untranslated Poco statements.
To create the tagspec tag:
1. Create a new blank file.
2. Enter the following:
<tagspec tag_name="poco" start_string="<#" end_string="#>" ¬
detect_in_attribute="true" icon="poco.gif" icon_width="17" ¬
icon_height="15"></tagspec>
3.
Save the file as poco.xml in the Configuration/ThirdPartyTags folder.
Seitenansicht 442
1 2 ... 438 439 440 441 442 443 444 445 446 447 448 ... 503 504

Kommentare zu diesen Handbüchern

Keine Kommentare