A Beginner’s Guide to Computer Programming
Start Programming Using HTML, CSS, and JavaScript is a manual for undergraduate students in engineering and the natural sciences to discover how computer programming works. Using a dialog format between two students and a professor, the text teaches students how the mainstream web languages HTML, CSS, and JavaScript interact and how to harness their capabilities in practical settings.
Each chapter focuses on a specific theme supported by a gradual development of engaging worked examples of live web documents and applications using the three languages. Students can follow most of the examples and experiments using any modern browser and plain text editor. A practical homework problem is included at the end of every chapter and then is discussed at the beginning of the next chapter. In addition, a related keywords list helps students review key topics.
By focusing on important established principles and concrete examples, this introductory book shows students how to write cleaner and more easily maintainable code. It augments the basic language syntax and rules with contents and structure while keeping the material simple and manageable.
Content and Structure
Opening
Introducing HTML
The Tools
Minimal HTML Document
Formatting a Page
Building a Sound Structure
Homework Discussion
Lists and Tables
Generic <div> and <span> Elements
Sectioning Elements
Hyperlinks
Character Entities
Presentation
Homework Discussion
Setting up a Web Server
Introducing CSS
CSS Values
CSS Properties
CSS Pixel Unit
More Control over Style
Homework Discussion
Class Selectors
ID Selectors
Grouping Selectors
Nesting Selectors
The HTML Ancestry Tree
Inheritance
Determining Style Specificity
Relative Sizes
Understanding CSS Boxes
Homework Discussion
CSS Box Model
Element Display
Positioning and Element Flow
Containing Block
Hiding Elements
Floated Elements
Special Selectors
Behavior
Homework Discussion
Server Side Includes
Introducing JavaScript
Values and Types
Operators and Expressions
Controlling Program Flow
Homework Discussion
Statements
Design a Simple Program
Type Conversions
Introducing Objects
Homework Discussion
switch Conditional
Math Object
do/while Loop
Date Object
Understanding Arrays and Strings
Homework Discussion
Array Object
for Loop
Array Methods
String Object
Understanding Functions
Homework Discussion
Writing Function Definitions
References to Function Objects
Variable Scope
Passing Function Arguments by Reference
The Scope Chain and Closures
Building Your Own Objects
Homework Discussion
JavaScript Objects Revisited
Classes
Constructor Overloading
Factory Methods
The prototype Object
More on Setting and Querying Object Properties
Sudoku Puzzle Helper
Using JavaScript to Control the Browser
Homework Discussion
Deeper into the Browser
Events
Scripting Documents
Timer Events
Scripting Styles
Introducing Forms
User Interface
Homework Discussion
Using Family Relations to Manipulate Elements
Completing Math Worksheet Generator
Completing Sudoku Puzzle Helper
Appendix A: Solution to the Last Homework: Sudoku Generator
Appendix B: Ways to Continue
Appendix C: HTML Mini Reference
Appendix D: CSS Mini Reference
Appendix E: JavaScript Mini Reference
Index
A homework problem appears at the end of each chapter.
Biography
Iztok Fajfar is an associate professor in the Faculty of Electrical Engineering at the University of Ljubljana, Slovenia. A programmer and writer, he teaches computer programming at all levels, from assembly to object-oriented. His research topics include evolutionary algorithms, particularly genetic programming. He earned a PhD in electrical engineering from the University of Ljubljana.