Pub. Date:
SitePoint Pty, Limited
Simply JavaScript / Edition 1

Simply JavaScript / Edition 1

by Kevin Yank, Cameron Adams


View All Available Formats & Editions
Current price is , Original price is $39.95. You
Select a Purchase Option
  • purchase options
    $21.07 $39.95 Save 47% Current price is $21.07, Original price is $39.95. You Save 47%.
  • purchase options
    $18.44 $39.95 Save 54% Current price is $18.44, Original price is $39.95. You Save 54%.
    Note: Access code and/or supplemental material are not guaranteed to be included with textbook rental or used textbook.
  • purchase options


Simply JavaScript / Edition 1

Everything you need to learn JavaScript from Scratch!

Packed with numerous examples, Simply JavaScript is a step-by-step introduction to programming in JavaScript the right way. Learn how easy it is to use JavaScript to solve real-world problems, build smarter forms, track user events (such as mouse clicks and key strokes), and design eye-catching animations. Then move into more powerful techniques using the DOM and Ajax.

  • Learn JavaScript's built-in functions, methods, and properties.
  • Easily integrate JavaScript in your web site.
  • Use JavaScript to validate form entries and interact with your users.
  • Understand how to respond to user events.
  • Create animations that bring your web site to life.
  • Start programming using the DOM and Ajax.

    Unlike other JavaScript books, modern best practices such as progressive enhancement, accessibility and unobtrusive scripting are used from the very beginning. All the code in the book is also cross-browser compatible and downloadable for free, so you can get started instantly!

  • Product Details

    ISBN-13: 9780980285802
    Publisher: SitePoint Pty, Limited
    Publication date: 06/01/2007
    Pages: 418
    Sales rank: 1,112,699
    Product dimensions: 7.00(w) x 9.00(h) x 0.90(d)

    About the Author

    Kevin Yank is a world-renowned leader in web development. When not writing best sellers, Kevin is the Technical Director of and editor of the popular SitePoint Tech Times newsletter.

    Cameron Adams is an author of multiple web development books and is often referred to as a "Web Technologist." In addition to his extensive JavaScript experience, Cameron's passions extend to CSS, PHP, and graphic design.

    Table of Contents

    Preface     xvii
    Who Should Read this Book?     xviii
    What's Covered in this Book?     xviii
    The Book's Web Site     xx
    The Code Archive     xx
    Updates and Errata     xx
    The SitePoint Forums     xxi
    The SitePoint Newsletters     xxi
    Your Feedback     xxi
    Acknowledgments     xxi
    Kevin Yank     xxi
    Cameron Adams     xxii
    Conventions Used in this Book     xxiii
    Code Samples     xxiii
    Tips, Notes, and Warnings     xxiv
    The Three Layers of the Web     1
    Keep 'em Separated     2
    Three Layers     4
    HTML for Content     6
    CSS for Presentation     8
    JavaScript for Behavior     9
    The Right Way     11
    JavaScript Libraries     11
    Let's Get Started!     12
    Programming with JavaScript     13
    Running a JavaScript Program     14
    Statements: Bite-sized Chunks for your Browser     17
    Comments: Bite-sized Chunks Just for You     18
    Variables: Storing Data for your Program     19
    Variable Types: Different Typesfor Different Data     23
    Conditions and Loops: Controlling Program Flow     35
    Conditions: Making Decisions     36
    Loops: Minimizing Repetition     43
    Functions: Writing Code for Later     48
    Arguments: Passing Data to a Function     50
    Return Statements: Outputting Data from a Function     52
    Scope: Keeping your Variables Separate     54
    Objects     55
    Unobtrusive Scripting in the Real World     58
    Summary     59
    Document Access     61
    The Document Object Model: Mapping your HTML     61
    Text Nodes     64
    Attribute Nodes     65
    Accessing the Nodes you Want     66
    Finding an Element by ID     67
    Finding Elements by Tag Name     70
    Finding Elements by Class Name     74
    Navigating the DOM Tree     79
    Interacting with Attributes     82
    Changing Styles     85
    Changing Styles with Class     87
    Example: Making Stripy Tables     92
    Finding All Tables with Class dataTable     93
    Getting the Table Rows for Each Table     94
    Adding the Class alt to Every Second Row      96
    Putting it All Together     96
    Exploring Libraries     99
    Prototype     99
    jQuery     100
    Dojo     102
    Summary     102
    Events     105
    An Eventful History     106
    Event Handlers     107
    Default Actions     111
    The this Keyword     112
    The Problem with Event Handlers     115
    Event Listeners     116
    Default Actions     119
    Event Propagation     122
    The this Keyword     127
    The Internet Explorer Memory Leak     128
    Putting it All Together     129
    Example: Rich Tooltips     132
    The Static Page     133
    Making Things Happen     134
    The Workhorse Methods     135
    The Dynamic Styles     140
    Putting it All Together     142
    Example: Accordion     144
    The Static Page     144
    The Workhorse Methods     146
    The Dynamic Styles     148
    Putting it All Together     150
    Exploring Libraries     158
    Summary     160
    Animation     163
    The Principles of Animation     163
    Controlling Time with JavaScript     165
    Using Variables with setTimeout     168
    Stopping the Timer     172
    Creating a Repeating Timer     174
    Stopping setInterval     175
    Revisiting Rich Tooltips     175
    Old-school Animation in a New-school Style     176
    Path-based Motion     181
    Animating in Two Dimensions     190
    Creating Realistic Movement     192
    Moving Ahead     198
    Revisiting the Accordion Control     198
    Making the Accordion Look Like it's Animated     198
    Changing the Code     199
    Exploring Libraries     208     208
    Summary     211
    Form Enhancements     213
    HTML DOM Extensions     214
    Example: Dependent Fields     216
    Example: Cascading Menus     226
    Form Validation     239
    Intercepting Form Submissions     240
    Regular Expressions     243
    Example: Reusable Validation Script     249
    Custom Form Controls     256
    Example: Slider     256
    Exploring Libraries      271
    Form Validation     272
    Custom Controls     274
    Summary     275
    Errors and Debugging     277
    Nothing Happened!     278
    Common Errors     282
    Syntax Errors     283
    Runtime Errors     288
    Logic Errors     292
    Debugging with Firebug     296
    Summary     303
    Ajax     305
    XMLHttpRequest: Chewing Bite-sized Chunks of Content     306
    Creating an XMLHttpRequest Object     307
    Calling a Server     310
    Dealing with Data     314
    A Word on Screen Readers     316
    Putting Ajax into Action     316
    Seamless Form Submission with Ajax     329
    Exploring Libraries     337
    Prototype     339
    Dojo     340
    jQuery     341
    YUI     341
    MooTools     342
    Summary     343
    Looking Forward     345
    Bringing Richness to the Web     346
    Easy Exploration     346
    Easy Visualization     347
    Unique Interaction     349
    Rich Internet Applications      352
    Widgets     355
    JavaScript Off the Web     356
    Exploring Libraries     357
    Dojo     358
    Google Web Toolkit     361
    Summary     362
    The Core JavaScript Library     363
    The Object     363
    Event Listener Methods     364
    Script Bootstrapping     375
    CSS Class Management Methods     378
    Retrieving Computed Styles     379
    The Complete Library     379
    Index     387

    Customer Reviews

    Most Helpful Customer Reviews

    See All Customer Reviews