HTML, XHTML, and CSS, Sixth Edition
Scripts sometimes contain symbols that have special meaning in XHTML documents, namely the & and the >. If you use these symbols in a script, you should enclose them in a CDATA section to hide them from XML parsers (the programs that ensure that the XML, or XHTML in this case, is properly written). To hide internal scripts from XML parsers:
Figure 19.19. This JavaScript script is adapted from Figure 20.1 on page 322. The CDATA section removes the special meaning from the characters in the script, essentially hiding them from the XML parser.
|
Категории