O'Reilly logo

Learning WML, and WMLScript by Martin Frost

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Comments

Sometimes you may find that you want to leave a remark in your WML file to remind you how it works at some later date, or you may want to temporarily remove part of a file while you are testing something else. Comments are the answer.

A comment starts with the four characters <!-- and ends with the three characters --> . Everything that appears between these two markers, including tags, body text, entities, and line breaks, is ignored. Here are some examples:

<!-- A simple comment. -->

<!--This is
a comment that
spans several lines.-->

You can’t nest comments. The following doesn’t work:

<!-- A simple <!-- EMBEDDED COMMENT, NOT! -->   comment. -->

Moreover, the two characters -- can’t appear within the body of a comment, only at the end, as part of the --> terminator.

If for some reason you want the sequence <!-- in your body text, write it with an entity (which you would have to do for the < anyway):

&lt;!--

You may be worrying about using comments. Surely they end up sending lots of extra data to the browser, and you keep being told how saving bandwidth is really important? Don’t worry: the WAP gateway removes all comments as part of its processing, so the browser doesn’t even know they exist.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required