Skip to Content
Real World XML
book

Real World XML

by Steven Holzner
January 2003
Beginner to intermediate content levelBeginner to intermediate
1200 pages
23h 42m
English
Peachpit Press
Content preview from Real World XML

Programming in JavaScript

In this chapter, we'll build our JavaScript foundation by getting the syntax of the language down. For example, you can make decisions based on your data values with the JavaScript if statement. In this code, I'm comparing the value 143 to 719; and if 719 is greater than 143, displaying the message The first value is greater than the second.:

Listing . ch06_03.html
 
<HTML>
    <HEAD>
        <TITLE>
            Using the JavaScript if Statement
        </TITLE>
    </HEAD>

    <BODY>
        <CENTER>
            <H1>
                Using the JavaScript if Statement
            </H1>
        </CENTER>
        <SCRIPT LANGUAGE="JavaScript">
            if(719 > 143){
					document.writeln(
					"The first value is greater than the second."
					)
					}
        </SCRIPT>
    </BODY>
</HTML>

You can see this Web page at work in Figure 6-3. As indicated in that page, ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Inside XML

Inside XML

Steven Holzner
XML Hacks

XML Hacks

Michael Fitzgerald

Publisher Resources

ISBN: 0735712867Purchase book