You are previewing JavaScript™ Phrasebook: Essential Code and Commands.
O'Reilly logo
JavaScript™ Phrasebook: Essential Code and Commands

Book Description

Developers are hungry for a concise, easy-to-use reference that puts essential code "phrases" at their fingertips. JavaScript, and the related AJAX, is hot and there is little to no information on how to use JavaScript to develop AJAX-based applications. While there are many JavaScript books on the market, most of them are dated and few cover the most recent developments, such as AJAX.

JavaScript Phrasebook is the guide to JavaScript and AJAX that you can and will take with you everywhere. Skipping the usual tutorial on JavaScript and introducing AJAX as one of the first published works on the topic, the JavaScript Phrasebook goes straight to practical JavaScript and AJAX tools, providing immediately applicable solutions for frequent tasks and code so flexible that it is easily adapted to the your individual needs.

Table of Contents

  1. JavaScript™ Phrasebook
    1. About the Author
      1. We Want to Hear from You!
      2. Reader Services
    2. Introduction
    3. 1. JavaScript Basics
        1. Understanding JavaScript (and Its History)
        2. Setting Up a Test System
        3. Configuring Web Browsers
        4. Including JavaScript Code
        5. Using External JavaScript Files
        6. Dynamically Loading JavaScript Files
        7. Using JavaScript Pseudo URLs
        8. Executing JavaScript with Event Handlers
        9. Coping with Browsers without JavaScript
    4. 2. Common Phrases
        1. Detecting the Browser Type
        2. Checking Browser Capabilities
        3. Preventing Caching
        4. Redirecting the Browser
        5. Reloading the Page
        6. Creating a Random Number
        7. Date and Time Information
        8. Searching with Regular Expressions
        9. Replacing Text
        10. Navigating within the Browser’s History
        11. Displaying the Modification Date of the Page
        12. Retrieving GET Parameters
        13. Asking for User Confirmation
        14. Asking for User Data
    5. 3. Images and Animations
        1. Creating Mouseover Buttons
        2. Preloading Images
        3. Animating Graphics
        4. Stretching Graphics
        5. Visualizing the Page Loading State with a Progress Bar
    6. 4. CSS
        1. Accessing CSS Styles
        2. Accessing CSS Classes
        3. Accessing Individual Style Sheets
        4. Accessing Individual CSS Rules
        5. Letting the Contents of a Website Disappear
        6. Applying JavaScript to CSS Selectors
        7. Changing the Mouse Cursor
    7. 5. DOM and DHTML
        1. Understanding DOM
        2. Understanding DHTML
        3. Accessing Specific Elements
        4. Accessing Tags
        5. Determining Node Information
        6. Removing Elements
        7. Adding Elements
        8. Creating Text Elements
        9. Working with Attributes
        10. Cloning Elements
        11. Replacing Elements
        12. Creating a Bulleted List from JavaScript Data
        13. Creating a Table from JavaScript Data
        14. Changing HTML Fragments
        15. Positioning Elements
        16. Moving Elements
        17. Creating a Sticky Navigation
        18. Creating a Flash Pop-Up Ad
    8. 6. OOP and Events
        1. Creating a Class
        2. Accessing Class Members
        3. Inheriting Classes
        4. Extending Built-In JavaScript Objects
        5. Reacting Upon JavaScript Events
        6. Using Keyboard Events
        7. Submitting a Form with the Enter Key
        8. Using Mouse Events
    9. 7. Cookies
        1. Understanding Cookies
        2. Setting Cookies
        3. Reading Out Cookies
        4. Setting an Expiration Date
        5. Using Other Cookie Options
        6. Deleting Cookies
        7. Checking for Cookie Support
        8. Saving Multiple Information in One Cookie
    10. 8. Forms
        1. Understanding HTML Forms with JavaScript
        2. Accessing Text Fields
        3. Accessing Check Boxes
        4. Accessing Radio Buttons
        5. Accessing Selection Lists
        6. Accessing a Multiple Selection List
        7. Disabling Form Elements
        8. Submitting a Form
        9. Preventing Form Submission
        10. Preventing Repeated Form Submissions
        11. Giving a Field the Focus
        12. Selecting Text in a Field
        13. Emptying Text Fields When Clicked Upon
        14. Validating Text Fields
        15. Validating Check Boxes
        16. Validating Radio Buttons
        17. Validating Selection Lists
        18. Automatically Validating a Form
        19. Implementing Navigation with a Selection List
        20. Implementing a Hierarchical Navigation with a Selection List
        21. Emptying a Set of Radio Buttons
        22. Creating Prefilled Date Selection Lists
        23. Creating Validating Date Selection Lists
    11. 9. Windows and Frames
        1. Using Window Options
        2. Opening a Modal Window
        3. Determining Screen Size
        4. Determining the Window Size
        5. Resizing a Window
        6. Repositioning a Window
        7. Opening a Centered Pop-Up Window
        8. Opening a Full-Screen Window
        9. Opening a New Window in a Corner of the Screen
        10. Creating a Sitemap
        11. Closing a Window
        12. Checking for the Presence of a Pop-Up Blocker
        13. Changing the Contents of Two Frames at Once
        14. Using Iframes
    12. 10. Web Services
        1. Creating a Web Service with PHP
        2. Creating a Web Service with ASP.NET
        3. Calling a Web Service from Internet Explorer
        4. Calling a Web Service from a Mozilla Browser
        5. Calling an ASP.NET Web Service from a Mozilla Browser
    13. 11. AJAX (and Related Topics)
        1. Initializing an AJAX Application
        2. Sending a GET Request
        3. Sending a POST Request
        4. Sending a Synchronous Request
        5. Receiving Multiple Data from the Server
        6. Aborting an HTTP Request
        7. Retrieving HTTP Headers
        8. Receiving XML from the Server
        9. Using JSON for Data (De)Serialization
        10. Creating a Waiting Screen
        11. Solving the Bookmark Problem
        12. Solving the Back Button Problem
        13. Using XSLT
        14. Using an XML Library
        15. Using the Yahoo! Web Service
    14. 12. Embedded Media
        1. Accessing Embedded Media
        2. Checking for Plug-Ins
        3. Coping with Recent Internet Explorer Versions
        4. Accessing Multimedia Content
        5. Accessing Java Content
        6. Accessing Flash Content