August 1999
Intermediate to advanced
1488 pages
72h 53m
English
String.prototype.property String.prototype.method
The prototype property of the String object allows a programmer to add properties or methods to a core JavaScript object.
Listing 6.246 creates two instances of the String object. Then it prototypes a new property, type, and a new method, verify(). In the script, the type property is assigned to the string instances and then they are checked using the verify() method. The results of the validation are then written to the user's page.
<script language="JavaScript1.1"> ... |
Read now
Unlock full access