O'Reilly logo

Real World XML by Steven Holzner

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

<script>—Using Script Programming

You use the <script> element to embed a script, such as those written in JavaScript in an XHTML document. You usually place this element in a document's <head> section, except when the code writes directly to the document's body—in that case, you should place it in the document's body. This element is supported in XHTML 1.0 Strict, XHTML 1.0 Transitional, XHTML 1.0 Frameset, and XHTML 1.1. Here are the attributes of this element:

  • charset— Gives the character encoding of the script contents. (XHTML 1.0 Strict, XHTML 1.0 Transitional, XHTML 1.0 Frameset, XHTML 1.1.)

  • defer— Tells the browser that the script is not going to generate any document content. (XHTML 1.0 Strict, XHTML 1.0 Transitional, XHTML 1.0 Frameset, ...

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