diff --git a/0101.html b/0101.html new file mode 100644 index 0000000..845b940 --- /dev/null +++ b/0101.html @@ -0,0 +1,7 @@ + + + + + diff --git a/0201.html b/0201.html new file mode 100644 index 0000000..d4424e5 --- /dev/null +++ b/0201.html @@ -0,0 +1,13 @@ + + +

+ +

+ + diff --git a/0202.html b/0202.html new file mode 100644 index 0000000..a4c4e39 --- /dev/null +++ b/0202.html @@ -0,0 +1,10 @@ + + +

+ +

+ + diff --git a/0203.html b/0203.html new file mode 100644 index 0000000..f871d9f --- /dev/null +++ b/0203.html @@ -0,0 +1,16 @@ + + +

+ +

+ + diff --git a/0204.html b/0204.html new file mode 100644 index 0000000..e0d55f5 --- /dev/null +++ b/0204.html @@ -0,0 +1,17 @@ + + +

+ +

+ + diff --git a/0301.html b/0301.html new file mode 100644 index 0000000..a258c0b --- /dev/null +++ b/0301.html @@ -0,0 +1,28 @@ + + +
+ + + + + + + + + + + + + + + + + + + + +
Enter Your Name:
Enter Your Age:
+
+ + diff --git a/0302.html b/0302.html new file mode 100644 index 0000000..0d6273d --- /dev/null +++ b/0302.html @@ -0,0 +1,27 @@ + + +

+ +

+ + diff --git a/0303.html b/0303.html new file mode 100644 index 0000000..cf7a7fb --- /dev/null +++ b/0303.html @@ -0,0 +1,72 @@ + + + + JavaScript "Rock, Scissors, Paper" Game + + + + +

+ Play "Rock, Scissors and Paper" the JavaScript way! +

+ +
+

Make a choice: +
+ Rock
+ Paper
+ Scissors +

+
+
+ +

+ + \ No newline at end of file diff --git a/0304.html b/0304.html new file mode 100644 index 0000000..ca1e758 --- /dev/null +++ b/0304.html @@ -0,0 +1,32 @@ + + +

+ +

+ + diff --git a/0305.html b/0305.html new file mode 100644 index 0000000..2aa406e --- /dev/null +++ b/0305.html @@ -0,0 +1,70 @@ + + + + JavaScript "Rock, Scissors, Paper" Game + + + + +

+ Play "Rock, Scissors, and Paper" the JavaScript way! +

+ +
+

Make a choice: +
+ Rock
+ Paper
+ Scissors +

+
+
+ +

+ + diff --git a/0401.html b/0401.html new file mode 100644 index 0000000..f10e22b --- /dev/null +++ b/0401.html @@ -0,0 +1,16 @@ + + +

+ +

+ + diff --git a/0402.html b/0402.html new file mode 100644 index 0000000..2c58ab7 --- /dev/null +++ b/0402.html @@ -0,0 +1,16 @@ + + +

+ +

+ + diff --git a/0403.html b/0403.html new file mode 100644 index 0000000..3e52d02 --- /dev/null +++ b/0403.html @@ -0,0 +1,18 @@ + + +

+ +

+ + diff --git a/0404.html b/0404.html new file mode 100644 index 0000000..fd784ea --- /dev/null +++ b/0404.html @@ -0,0 +1,31 @@ + + +
+ +
+ + \ No newline at end of file diff --git a/0501.html b/0501.html new file mode 100644 index 0000000..c6fbfd8 --- /dev/null +++ b/0501.html @@ -0,0 +1,17 @@ + + +

+ +

+ + diff --git a/0502.html b/0502.html new file mode 100644 index 0000000..3100ebd --- /dev/null +++ b/0502.html @@ -0,0 +1,24 @@ + + + + Add three numbers + + + + +
+ + + + +
+ + diff --git a/0503.html b/0503.html new file mode 100644 index 0000000..220da1d --- /dev/null +++ b/0503.html @@ -0,0 +1,29 @@ + + + + Add three numbers + + + + +
+ + + + + + + +
+
+
+ + diff --git a/0504.html b/0504.html new file mode 100644 index 0000000..df452e0 --- /dev/null +++ b/0504.html @@ -0,0 +1,30 @@ + + + + Add all of the numbers + + + + +
+ + + + + + + +
+
+
+ + diff --git a/0505.html b/0505.html new file mode 100644 index 0000000..a871cd2 --- /dev/null +++ b/0505.html @@ -0,0 +1,41 @@ + + + + Counting rabbits... + + + + +
+ + + +
+ +
+
+ + diff --git a/0506.html b/0506.html new file mode 100644 index 0000000..004a43c --- /dev/null +++ b/0506.html @@ -0,0 +1,47 @@ + + + + Simple dialogs + + + + +
+ + + + + + + +
+ +
+ +
+ +
+
+ + diff --git a/0601.html b/0601.html new file mode 100644 index 0000000..4762b93 --- /dev/null +++ b/0601.html @@ -0,0 +1,21 @@ + + + + Year of the ? + + + +

+ +

+ + diff --git a/0602.html b/0602.html new file mode 100644 index 0000000..53acac8 --- /dev/null +++ b/0602.html @@ -0,0 +1,26 @@ + + + + Iteration + + + +

+ +

+ + diff --git a/0603.html b/0603.html new file mode 100644 index 0000000..355f88d --- /dev/null +++ b/0603.html @@ -0,0 +1,32 @@ + + + + Iteration Two + + + + +

+ +

+ + diff --git a/0604.html b/0604.html new file mode 100644 index 0000000..4f65fc2 --- /dev/null +++ b/0604.html @@ -0,0 +1,22 @@ + + + +Simple Stack Example + + + +

+ +

+ + diff --git a/0605.html b/0605.html new file mode 100644 index 0000000..e5f1b11 --- /dev/null +++ b/0605.html @@ -0,0 +1,42 @@ + + + Stacking up! + + + + +
+ + + + + +
+ + \ No newline at end of file diff --git a/0606.html b/0606.html new file mode 100644 index 0000000..44dac5a --- /dev/null +++ b/0606.html @@ -0,0 +1,41 @@ + + + +Two-dimensional array work around + + + + + + diff --git a/0607.html b/0607.html new file mode 100644 index 0000000..f07c87e --- /dev/null +++ b/0607.html @@ -0,0 +1,23 @@ + + + +Array methods + + + +

+ +

+ + diff --git a/0608.html b/0608.html new file mode 100644 index 0000000..98db7ae --- /dev/null +++ b/0608.html @@ -0,0 +1,24 @@ + + + +Numeric comparison + + + +

+ +

+ + diff --git a/0609.html b/0609.html new file mode 100644 index 0000000..e537435 --- /dev/null +++ b/0609.html @@ -0,0 +1,29 @@ + + + +Case-insensitive comparison + + + +

+ +

+ + diff --git a/0610.html b/0610.html new file mode 100644 index 0000000..c0ceddf --- /dev/null +++ b/0610.html @@ -0,0 +1,50 @@ + + + + Elements Array + + + + + + diff --git a/0701.html b/0701.html new file mode 100644 index 0000000..9fa9165 --- /dev/null +++ b/0701.html @@ -0,0 +1,17 @@ + + + Properties + + +

+ +

+ + \ No newline at end of file diff --git a/0702.html b/0702.html new file mode 100644 index 0000000..6876e1d --- /dev/null +++ b/0702.html @@ -0,0 +1,14 @@ + + + Methods + + +

+I'm not even fully opened yet! + +

+ + \ No newline at end of file diff --git a/0703.html b/0703.html new file mode 100644 index 0000000..e82c714 --- /dev/null +++ b/0703.html @@ -0,0 +1,11 @@ + + + onMouseOver Event + + +

+ + Please do not leave me! +

+ + \ No newline at end of file diff --git a/0704.html b/0704.html new file mode 100644 index 0000000..79cd394 --- /dev/null +++ b/0704.html @@ -0,0 +1,14 @@ + + + Window Object Properties Array + + + + + \ No newline at end of file diff --git a/0705.html b/0705.html new file mode 100644 index 0000000..980b478 --- /dev/null +++ b/0705.html @@ -0,0 +1,24 @@ + + + Associative object arrays + + + + + \ No newline at end of file diff --git a/0706.html b/0706.html new file mode 100644 index 0000000..c0f2e80 --- /dev/null +++ b/0706.html @@ -0,0 +1,34 @@ + + +Instance method demo + + +

+ +

+ + diff --git a/0707.html b/0707.html new file mode 100644 index 0000000..3389482 --- /dev/null +++ b/0707.html @@ -0,0 +1,42 @@ + + + Custom objects and associative object arrays + + + + + + \ No newline at end of file diff --git a/0708.html b/0708.html new file mode 100644 index 0000000..f011892 --- /dev/null +++ b/0708.html @@ -0,0 +1,30 @@ + + +Instance method demo + + +

+ +

+ + diff --git a/0709.html b/0709.html new file mode 100644 index 0000000..64716f3 --- /dev/null +++ b/0709.html @@ -0,0 +1,205 @@ + + +Tchatshke Gulch - The world's smallest on-line marketplace + + + +

Tchatshke Gulch

+

World's smallest on-line marketplace

+ + + + + +
+ + +
+ + + + + + +
Enter lot number:
Enter description:
Enter starting bid:
Enter bid increment:
+
+ +
+ + +
+ + + + +
Enter your name:
Enter maximum bid:
+
+ + +
+ + +
+ + + + + + + +
+
+ + + +
+ + + + + diff --git a/0801.html b/0801.html new file mode 100644 index 0000000..32f3e95 --- /dev/null +++ b/0801.html @@ -0,0 +1,36 @@ + + + Keystroke detector + + + + +
+ + +
+ + + \ No newline at end of file diff --git a/0802.html b/0802.html new file mode 100644 index 0000000..867e310 --- /dev/null +++ b/0802.html @@ -0,0 +1,38 @@ + + + On Close + + + + + \ No newline at end of file diff --git a/0803.html b/0803.html new file mode 100644 index 0000000..7961cf4 --- /dev/null +++ b/0803.html @@ -0,0 +1,70 @@ + + + Text Input Events + + + +
+ + + + +
+Enter Your First Name: + + +
+Enter Your Last Name: + + +
+Enter Your Profession: + + +
+Enter Your City: + + +
+ +
+
+ + \ No newline at end of file diff --git a/0804.html b/0804.html new file mode 100644 index 0000000..3706ad0 --- /dev/null +++ b/0804.html @@ -0,0 +1,47 @@ + + +An event of my own! + + + + + + + + + + +
Name your object:
Enter first text:
Enter second text:
+ + diff --git a/0805.html b/0805.html new file mode 100644 index 0000000..77d4db5 --- /dev/null +++ b/0805.html @@ -0,0 +1,44 @@ + + +As time goes by... + + + + + + + + + + + +
Name your object:
+ + diff --git a/0806.html b/0806.html new file mode 100644 index 0000000..7c6b965 --- /dev/null +++ b/0806.html @@ -0,0 +1,211 @@ + + +Tchatshke Gulch - The world's smallest on-line marketplace + + + +

Tchatshke Gulch

+

World's smallest on-line marketplace

+

New and improved, featuring automatic bid updating!

+ + + + + + +
+ + +
+ + + + + + +
Enter lot number:
Enter description:
Enter starting bid:
Enter bid increment:
+
+ +
+ + +
+ + + + +
Enter your name:
Enter maximum bid:
+
+ + +
+ + +
+ + + + + + + +
+
+ + + +
+ + + + + diff --git a/0901.html b/0901.html new file mode 100644 index 0000000..2afeeda --- /dev/null +++ b/0901.html @@ -0,0 +1,13 @@ + + +A link is a link is a link... + + +

+ +

+ + diff --git a/0902.html b/0902.html new file mode 100644 index 0000000..71c08ce --- /dev/null +++ b/0902.html @@ -0,0 +1,46 @@ + + + Validate + + + +

+Pearly Gates Admission Form! +

+Note: Fields marked with an asterisk (*) are required. Saint Peter will know if you lie. +
+ + + + +
+Enter Your First Name (*): + + +
+Enter Your Last Name (*): + + +
+Enter Your Profession (*): + + +
+Enter Your City: + + +
+ +
+
+ + \ No newline at end of file diff --git a/0903.html b/0903.html new file mode 100644 index 0000000..727e6d2 --- /dev/null +++ b/0903.html @@ -0,0 +1,101 @@ + + + String Play + + + +

+Playing with strings! +

+ +
+ + + + + + + + + + + +
+Enter a text string: +
+ +
+ + + + + + + + + +
+

+Results
+
+ +
+ +
+
+ + \ No newline at end of file diff --git a/0904.html b/0904.html new file mode 100644 index 0000000..ad576dc --- /dev/null +++ b/0904.html @@ -0,0 +1,34 @@ + + + Can I have a date, please? + + + +

+Check a date format today! +

+
+ + + + +
+Enter a date in mm/dd/yyyy format: +
+ +
+ +
+
+ + \ No newline at end of file diff --git a/0905.html b/0905.html new file mode 100644 index 0000000..acfee4b --- /dev/null +++ b/0905.html @@ -0,0 +1,54 @@ + + + Strim a tring + + + +

+Trim a string today! +

+
+ + + +
+Enter string for trimming: +
+ +
+ + + +


+Here's the trimmed string: +
+ +
+
+ + \ No newline at end of file diff --git a/1001.html b/1001.html new file mode 100644 index 0000000..b7c83f7 --- /dev/null +++ b/1001.html @@ -0,0 +1,21 @@ + + +Don't bug me, please! + + + +

+ +

+
+ +
+ + diff --git a/1002.html b/1002.html new file mode 100644 index 0000000..84beaab --- /dev/null +++ b/1002.html @@ -0,0 +1,58 @@ + + + Squash Bugs! + + + +

+Squash Those Bugs! +

+ +
+ + + + + + + + + +
+Enter a text string: +
+ +
+ + + +
+

+Results
+
+ +
+ +
+
+ + \ No newline at end of file diff --git a/1003.html b/1003.html new file mode 100644 index 0000000..dee2923 --- /dev/null +++ b/1003.html @@ -0,0 +1,61 @@ + + + Squash Bugs! + + + +

+Squash Those Bugs! +

+ +
+ + + + + + + + + +
+Enter a text string: +
+ +
+ + + +
+

+Results
+
+ +
+ +
+
+ + \ No newline at end of file diff --git a/1004.html b/1004.html new file mode 100644 index 0000000..4c28a90 --- /dev/null +++ b/1004.html @@ -0,0 +1,31 @@ + + +Don't bug me, please! + + + +

+ +

+
+ +
+ + diff --git a/1005.html b/1005.html new file mode 100644 index 0000000..af3918e --- /dev/null +++ b/1005.html @@ -0,0 +1,40 @@ + + + Throw that error! + + + + +

+Throw that error! +

+ +
+ + + + + + + + +
+Enter text for the error: + + +
+ + +
+
+ + \ No newline at end of file diff --git a/1006.html b/1006.html new file mode 100644 index 0000000..33935ae --- /dev/null +++ b/1006.html @@ -0,0 +1,43 @@ + + + Catch that error! + + + +

+Catch that error! +

+
+ + +
+We can handle 42: + + +
+ + +
+
+ + \ No newline at end of file diff --git a/1101.html b/1101.html new file mode 100644 index 0000000..50c215a --- /dev/null +++ b/1101.html @@ -0,0 +1,16 @@ + + + +Test that password + + + + + + \ No newline at end of file diff --git a/1102.html b/1102.html new file mode 100644 index 0000000..de4676f --- /dev/null +++ b/1102.html @@ -0,0 +1,37 @@ + + + Visualize Your Butterfly! + + +

+Visualize Your Butterfly! +

+Pass your mouse over a pattern to see the butterfly wearing it! +

+ + + + + + + +
+ + + + + + + + + +
+ + diff --git a/1103.html b/1103.html new file mode 100644 index 0000000..9cac20b --- /dev/null +++ b/1103.html @@ -0,0 +1,53 @@ + + + Slide Show + + + +

View a slide show of our garden today!

+
+ + +
+ + + + + +

+
+ + + diff --git a/3973.html b/3973.html new file mode 100644 index 0000000..a174966 --- /dev/null +++ b/3973.html @@ -0,0 +1,24 @@ + + + +Errata - Learn How to Program by Harold Davis + + + +

+Errata - Learn How to Program by Harold Davis +

+

+ + + + + + + +
Page & ChapterCorrectionComments
Top of page 123, Ch 5In code Listing 5-5, the function called towards the end of the listing should be named "addNums()" rather than "addThreeNums()". +This conforms to the explanation in the text of the chapter. +This is a typographic error in the code listing. Thanks to reader Brian Ball for pointing it out. +
+ + \ No newline at end of file diff --git a/9781590591130.jpg b/9781590591130.jpg new file mode 100644 index 0000000..12d3262 Binary files /dev/null and b/9781590591130.jpg differ diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..f1c48f1 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,27 @@ +Freeware License, some rights reserved + +Copyright (c) 2004 Harold Davis + +Permission is hereby granted, free of charge, to anyone obtaining a copy +of this software and associated documentation files (the "Software"), +to work with the Software within the limits of freeware distribution and fair use. +This includes the rights to use, copy, and modify the Software for personal use. +Users are also allowed and encouraged to submit corrections and modifications +to the Software for the benefit of other users. + +It is not allowed to reuse, modify, or redistribute the Software for +commercial use in any way, or for a user’s educational materials such as books +or blog articles without prior permission from the copyright holder. + +The above copyright notice and this permission notice need to be included +in all copies or substantial portions of the software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS OR APRESS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + diff --git a/LearnToProgram.html b/LearnToProgram.html new file mode 100644 index 0000000..b7a9aa2 --- /dev/null +++ b/LearnToProgram.html @@ -0,0 +1,12 @@ + + + +Learn to Program + + + +

+You made it: You're in like Flynn. +

+ + \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..e6ad0be --- /dev/null +++ b/README.md @@ -0,0 +1,15 @@ +#Apress Source Code + +This repository accompanies [*Learn How to Program Using Any Web Browser*](http://www.apress.com/9781590591130) by Harold Davis (Apress, 2004). + +![Cover image](9781590591130.jpg) + +Download the files as a zip using the green button, or clone the repository to your machine using Git. + +##Releases + +Release v1.0 corresponds to the code in the published book, without corrections or updates. + +##Contributions + +See the file Contributing.md for more information on how you can contribute to this repository. diff --git a/bubble1-swatch.gif b/bubble1-swatch.gif new file mode 100644 index 0000000..ad1ed10 Binary files /dev/null and b/bubble1-swatch.gif differ diff --git a/bubble1.gif b/bubble1.gif new file mode 100644 index 0000000..5195baa Binary files /dev/null and b/bubble1.gif differ diff --git a/bubble2-swatch.gif b/bubble2-swatch.gif new file mode 100644 index 0000000..843921b Binary files /dev/null and b/bubble2-swatch.gif differ diff --git a/bubble2.gif b/bubble2.gif new file mode 100644 index 0000000..85c0076 Binary files /dev/null and b/bubble2.gif differ diff --git a/check1-swatch.gif b/check1-swatch.gif new file mode 100644 index 0000000..c173e98 Binary files /dev/null and b/check1-swatch.gif differ diff --git a/check1.gif b/check1.gif new file mode 100644 index 0000000..b55069e Binary files /dev/null and b/check1.gif differ diff --git a/check2-swatch.gif b/check2-swatch.gif new file mode 100644 index 0000000..b4320d4 Binary files /dev/null and b/check2-swatch.gif differ diff --git a/check2.gif b/check2.gif new file mode 100644 index 0000000..0a0bdeb Binary files /dev/null and b/check2.gif differ diff --git a/contributing.md b/contributing.md new file mode 100644 index 0000000..f6005ad --- /dev/null +++ b/contributing.md @@ -0,0 +1,14 @@ +# Contributing to Apress Source Code + +Copyright for Apress source code belongs to the author(s). However, under fair use you are encouraged to fork and contribute minor corrections and updates for the benefit of the author(s) and other readers. + +## How to Contribute + +1. Make sure you have a GitHub account. +2. Fork the repository for the relevant book. +3. Create a new branch on which to make your change, e.g. +`git checkout -b my_code_contribution` +4. Commit your change. Include a commit message describing the correction. Please note that if your commit message is not clear, the correction will not be accepted. +5. Submit a pull request. + +Thank you for your contribution! \ No newline at end of file diff --git a/readme.txt b/readme.txt new file mode 100644 index 0000000..4448857 --- /dev/null +++ b/readme.txt @@ -0,0 +1,48 @@ +Readme file for source code associated with "Learn How to Program: Using Any Web Browser" +by Harold Davis +Published by Apress +(C) Harold Davis 2004. All rights reserved. +ISBN 1-59059-113-5 + +Please note: I recommend that you hand enter code rather than downloading it. +That way you will learn more, and have more fun, too! + +INSTRUCTIONS: + +The source code is organized in HTML files by chapter, so the first two digits in each file name +designate the chapter the source file is associated with. For example, 0301.html is the first +program in Chapter 3 of "Learn How to Program." (Note that the sequential numbering of source +files within each chapter does not correspond to the listing numbers in the book, because some +programs are represented by more than one book code listing.) + + +To run the programs, first download the zip archive to your computer. Next, unzip the file to +the folder of your choice. (Presumambly you've already successfully performed these steps as +you are reading this!) Finally, open each HTML file in your Web browser (for detailed instructions +about how to do this, see "Writing and Running Your First Program" in +Chapter 1 of "Learn How to Program"). + + +You can view the source code of any HTML file that is open in a Web browser. To do this in +Internet Explorer, choose Source from the View menu. In Mozilla or Netscape, choose +Page Source from the View menu. + + +Finally, you should note that this zip archive contains a few miscellaneous files used in +Chapter 11 in addition to source code files. These are the .Gif files used in the rollover +example, and "LearnToProgram.html," which is the "password protected lite" example +file used in that chapter. + + +Thanks for reading my book. + + +I am always interested in hearing about problems with the source code, or suggestions for +improvements or extensions to any of the examples. + + +Harold Davis +learntoprogram@bearhome.com + + + diff --git a/white.gif b/white.gif new file mode 100644 index 0000000..ff66a1f Binary files /dev/null and b/white.gif differ