Publishing Books Using XML Technologies
Dr. Herong Yang, Version 4.01

What Is JavaScript?

This section provides you some basics of JavaScript language.

JavaScript is simple scripting language that can be used inside Web pages to generate dynamic page contents. From a language syntax point of view, JavaScript is very similar to Java. JavaSctipt supports the following basic features:

  • Variables
  • Arrays
  • Arithmetic expressions
  • String expressions
  • Logical expressions
  • Conditional statements
  • Loops
  • Buit-in functions
  • User-defined functions
  • Accessing browser window and document objects

JavaScript statements can be included in Web pages using the "script" element as shown in the following example:

<p>Your random number is: 
<script type="text/javascript">
number = Math.round((Math.random()*9)+1);
document.write(number);
</script>
</p>

Table of Contents

 About This Book

 Ideas on Publishing Books using XML

 Overview of hyPub - A Simple XML Publishing Tool

 Writing Book Contents in XHTML Source Files

 Transforming Book Source Files with XSL Technology

 Designing Web Page Layouts with Tables

 Controlling Web Page Appearance with CSS

Sharing HTML Codes with JavaScript Files

What Is JavaScript?

 How JavaScript Is Used in hyPub?

 Generating Web Pages with hyPub

 Formatting Printable Documents with XSL-FO

 Generating PDF Documents with hyPub

 Areas of Future Improvements

 References

 PDF Printing Version

Dr. Herong Yang, updated in 2007
What Is JavaScript?