js24
Java Script in 24 Hours - Hour 6:








pg.87 - functions - Defining a Function

HTML and JavaScript code (in head section) =

results:

HTML file "JS in 24 hours" - listing 6.1




pg.88 - functions - Calling the Function

JavaScript code in head =

JavaScript code in body =

results:

HTML file "JS in 24 hours" - listing 6.2




pg.89 - functions - Returning a Value

JavaScript code in head =

JavaScript code in body =

results:

HTML file "JS in 24 hours" - listing 6.3




pg.89 - functions - Returning a Value

JavaScript code in head =

JavaScript code in body =

results:

HTML file "JS in 24 hours" - listing 6.3




pg.90-91 - objects - Objects

JavaScript code in body =

results:





pg.92-94 - objects - Using Objects to Simplify Scripting

JavaScript code in body =

results:






pg.95 - objects - Adding a Method to a String Object

JavaScript code in body =

results:

HTML file "JS in 24 hours" - listing 6.4




pg.96 - objects - Storing Data in Objects

JavaScript code =

HTML code =

results:

JavaScript file "JS in 24 hours" - listing 6.5
HTML file "JS in 24 hours" - listing 6.6