Outputting Text
In JavaScript output can be directed to several places including the current document, window and
pop-up dialog boxes.
Outputting text to the document window.
The [Link]() and [Link]() Methods
The document object in JavaScript includes two methods designed for outputting text to the client
window: write() and writeln(). In JavaScript, methods are called by combining the object name with
the method name:
[Link]-name
Data that the method needs to perform its job is provided as an argument in the parentheses; for
example:
[Link]("Test");
[Link]('Test');
Arguments are data provided to a function or a method for use in its calculations and
processing. They are provided (or passed) to the function or method by listing them in the
parentheses following the function or method name. Multiple arguments are separated by
commas.
The write() method outputs text and HTML as a string of text to the current window in sequence with
the current HTML
The writeln() method is the same as the write() method except that it adds a carriage return at the end
of the string that is being output.