Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
Microsoft® Start Here!™ Learn JavaScript
Dedication
A Note Regarding Supplemental Files
Introduction
Who Should Read This Book
Assumptions
Who Should Not Read This Book
Organization of This Book
Conventions and Features in This Book
System Requirements
Code Samples
Installing the Code Samples
Using the Code Samples
Acknowledgments
Errata and Book Support
We Want to Hear from You
Stay in Touch
1. What Is JavaScript?
A First JavaScript Program
Where JavaScript Fits
HTML, CSS, and JavaScript
HTML
CSS
JavaScript
JavaScript in Windows 8
Placing JavaScript in a Webpage
No JavaScript? No Problem.
Writing Your First JavaScript Program
Writing JavaScript in Visual Studio 11
JavaScript’s Limitations
Don’t Rely on JavaScript for Data Security
You Can’t Force JavaScript on Clients
Summary
2. JavaScript Programming Basics
JavaScript Placement: Revisited
Basic JavaScript Syntax
JavaScript Statements and Expressions
Names and Reserved Words
Spacing and Line Breaks
Comments
Case Sensitivity
Operators
JavaScript Variables and Data Types
Variables
Data Types
Numbers
Strings
Booleans
Null
Undefined
Looping and Conditionals in JavaScript
Loops in JavaScript
Conditionals in JavaScript
A Conditional Example
Summary
3. Building JavaScript Programs
Functions
Function Overview
Function Arguments
Calling Functions
Return Values
Function Examples
A Simple Example
Refactoring addNumbers()
Scoping Revisited
Objects in JavaScript
What Does an Object Look Like?
Properties
Methods
Using the this Keyword
Object Enumeration
Classes
Debugging JavaScript
Debugging as a Process
Debugging in Internet Explorer
Summary
4. JavaScript in a Web Browser
JavaScript Libraries
Getting jQuery
Using a Local Copy of jQuery
Using a CDN-Hosted jQuery Library
Testing jQuery
Getting jQuery UI
Adding jQuery UI to a Project
Testing jQuery UI
The Browser Object Model
Events and the window Object
The screen Object
The navigator Object
The location Object
The DOM
DOM Versions
The DOM Tree
Retrieving Elements with JavaScript and jQuery
Using jQuery, Briefly
The ready() Function
jQuery Selectors
Retrieving Elements by ID
Retrieving Elements by Class
Retrieving Elements by HTML Tag Name
Summary
5. Handling Events with JavaScript
Common Events with JavaScript
Handling Mouse Events
Preventing the Default Action
Attaching to an Element with On
Validating Web Forms with jQuery
Validating on Submit
Regular Expressions
Other Common Matches
Finding the Selected Radio Button or Check Box
Validating Radio Buttons and Check Boxes
Determining the Selected Drop-Down Element
Validating <select> Elements
Wrapping Up Form Validation
The click Event Revisited
Keyboard Events and Forms
Summary
6. Getting Data into JavaScript
AJAX in Brief
On Servers, GETs, and POSTs
Building a Server Program
PHP Example
AJAX and JavaScript
Retrieving Data with jQuery
Using get() and post()
Using the get() and post() Functions
Sending Data in the Request
Building an Interactive Page
Error Handling
Chaining an Error Handler
Using JSON for Efficient Data Exchange
Using getJSON()
Sending Data to the Server
Sending Data with getJSON
Sending Post Data
Summary
7. Styling with JavaScript
Changing Styles with JavaScript
CSS Revisited
Changing CSS Properties
Working with CSS Classes
Determining Classes with hasClass()
Adding and Removing Classes
Adding Error Styling to a Form
Advanced Effects with jQuery UI
Using Effects to Enhance a Web Application
Using jQuery UI Widgets
Building a Slider
Creating a Calendar
Other Helpful jQuery UI Widgets
Putting It All Together: A Space Travel Demo
Code Analysis
Code Analysis
Summary
8. Using JavaScript with Microsoft Windows 8
JavaScript Is Prominent in Windows 8
A Stroll Through a Windows 8 Application
Quick Checkpoint: Windows 8 Apps
Quick Checkpoint: Windows 8 Apps
Building a Windows 8 App
Building the Application
Code Analysis
Defining a Splash Screen, Logos, and a Tile
Summary
Index
About the Author
Copyright
← Prev
Back
Next →
← Prev
Back
Next →