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

Using Object Properties and Methods in JavaScript

JavaScript programming centers on objects, to a large extent. We've already seen the document object and seen that one way to use that object is to use methods such as writeln to indicate that you want to write to a Web page. To use a method, you use the object's name, followed by a dot (.) and then the method name, such as document.writeln. Here are a few examples of methods:

  • document.write— Writes to the body of the current Web page

  • document.writeln— Writes to the body of the current Web page and ends the text with a carriage return

  • history.go— Makes the browser navigate to a particular location in the browser's history list

  • window.alert— Makes the browser display an alert dialog box

  • window.open ...

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