templates
Can create yourself using JavaScript's predefined dosses
templates. A class is like a cool cutter for an object-it
defines the object's type. We'll free
web templates see how to use
web templates the nJ operator to create objects from JavaScript
classes in the Immediate Solutit section "Creating
JavaScript Objects". There are many other utility
classes, 1|| the Date and Math classes in which you have
to create your own objects before you can use them.
We'll free web templates see how
that works in the Immediate Solution section "Creating
JavaScript Objects". There are two aspects of objects
that you have to know about to be able to free sites anywhere
in JavaScript-methods, which we've already seen, and properties
We've seen that web templates the document object refers
to the current page, but how do actually use such an object?
Well, we've already seen one way, which is to object methods.
You can change websites that color.
Here are some template example properties and the objects
they belong to: document.bgcolor-Background free templates
color of the current page. document.fgcolor-Foreground
color of the current page. website
templates document.lastmodified-Date the page was last
modified.
free web sites
Such as the writeln method to write text to the Web page.
use a method of an object by template giving the object's
name a dot (.') followed by method name, such as document.writeln.
Here are a few examples for website templates of method'
Writes text to the current Web page. document.writeln-Writes
text to the current Web page and adds a carriagj return.
Navigates the Web free
website templatesbrowser to
a templates location in the browser's history. Displays
an alert dialog box. Opens a new browser window. free
website templates As you can see, these methods provide
a lot of ready-made power for you to work with web templates
the browser interactively. Besides
performing actions with objects
using meth'ods, you can website builder also read and
change settings in those objects using properties. A property
holds some setting of an object. For example, the document.linkcolor
property holds the color of unvisited hyperlinks in the
current Web page, and by changing the documentJinkcolor
property. document.title-Title
of the current page. Location website page hostname-Name
of the Internet Service Provider (ISP) host. o navigator-appName-Name
of the
browser, which you can webpage templates use to determine
what browser the user has. Object properties and methods
give you access to what's going on in the browser, letting
you change just website templates about everything under
programmatic control. In this, we're going to master the
basics of JavaScript programming, and in, we'll work with
the built-in objects.
|