The
output above was produced by the code below:
<SCRIPT>
// navigator Object provides use
information about the browser in
// navigator.appName => The name of
the browser
// navigator.appVersion => Version
information for the browser
// navigator.userAgent =>
// The string passed by the browser as
the user-agent header in HTTP requests
document.write(navigator.appName + "<BR>");
document.write(navigator.appVersion + "<BR>");
document.write(navigator.userAgent + "<BR>");
// The variable example is equal to
"An Example"
var example = "An Example";
// The variable example is
converted by document.write to "An Example"
// & concatenated with the string
" of how to use concatenation <BR>"
// which also contains embedded HTML
document.write("<BR>" + example + " of how to use
concatenation <BR>");
// instead of using + to
concatenate, we can use the same procedure by using commas (,)
// NOTE also \'' which means do not
treat this quotation mark as opening or closing quotation
// for document.write, but rather as a
literal to be printed out to the page.
document.write("<BR>", example, " of another way to
use \"concatenation\"", "<BR>");
// -- OR --
// document.write('<BR>', example, ' of another way to use
"concatenation"', '<BR>');
</SCRIPT>
<BODY>
This text is plain.<BR>
<B>
<SCRIPT>
document.write("This text is bold.</B>");
</SCRIPT> |