HTML and CSS Reference
In-Depth Information
Figure 10-22
inserting a link to the spam.js script file
Next you want to confirm that the stringReverse() function from the spam.js file is
working correctly. To test the function, you'll call it to reverse the text string values of the
userName and emServer parameters in the showEM() function.
To test the stringReverse() function:
1. Scroll down to the showEM() function.
2. Insert the following two lines of code at the top of the function, as shown in
Figure 10-23:
Figure 10-23
calling the stringReverse() function
reverses the order
of characters in
the userName
and emServer
parameter values
3. Save your changes to the file, and then reload mpl.htm in your Web browser. As
shown in Figure 10-24, the text of the username and mail server portions of each
employee's e-mail address appears reversed on the Web page.
Figure 10-24
staff directory with the e-mail addresses reversed
text of each u s ername and
e-mail server is reversed
Search WWH ::

Custom Search