معرفی کتاب «Pro JavaScript™ RIA Techniques: Best Practices, Performance, and Presentation» نوشتهٔ Dennis Odell، منتشرشده توسط نشر Apress : Imprint: Apress در سال 2009. این کتاب در فرمت pdf، زبان انگلیسی ارائه شده است. «Pro JavaScript™ RIA Techniques: Best Practices, Performance, and Presentation» در دستهٔ بدون دستهبندی قرار دارد.
Книга Pro Javascript RIA Techniques: Best Practices, Performance and Presentation Pro Javascript RIA Techniques: Best Practices, Performance and PresentationКниги Java Script Автор: Den Odell Год издания: 2009 Формат: pdf Издат.:Apress Страниц: 415 Размер: 2,2 ISBN: 9781430219347 Язык: Английский0 (голосов: 0) Оценка:Pro JavaScript RIA Techniques: Best Practices, Performance, and Presentation shows you how you can build JavaScript RIAs (Rich Internet Applications) with compelling user interfaces and great performance.With the best practices and optimization techniques you’ll learn in this book, you can optimize performance without sacrificing a rich user interface. Using a combination of innovative ideas and intelligent use of HTML, CSS, JavaScript, and plug–ins, this book shows you how to make decisions based on best web standard development practices and real–world browser data.Through practical examples, you’ll see how to optimize both design and performance with an eye toward future enhancements and efficient maintenance.\* Starting with the essential principles and techniques of semantic markup, build efficient, responsive web applications based on web standard best practices and real–world experience.\* Apply practical techniques and see how to reuse examples of broadly relevant page components to improve the interface and performance of existing sites.\* Explore ways to push the boundaries of the possible with existing browser technology.What you“ll learn\* Best practices for building web applications using JavaScript and web standards\* Optimization techniques for high performance in browsers\* How to create richer user interfaces\* Advanced Ajax techniques\* How to optimize graphic performance by drawing in the browser with SVG\* Integrating accessibility into rich web applicationsWho is this book forThis book is aimed at web developers and designers who need to improve the user experience of their sites by making their code more efficient and their sites more responsive, and incorporating more complexity all at the same time. It is for Internet professionals ready to go beyond Web 2.0 to a newer, more streamlined vision of rich user experiences. Prelims 1 Contents at a Glance 7 Contents 9 About the Author 17 About the Technical Reviewer 19 Acknowledgments 21 Introduction 23 Building a Solid Foundation 27 Best Practice Overview 27 Who Put the fiBestfl in Best Practic 28 Who Benefits from Best Practices? 28 Web Developers 28 Search Engines and Other Automated Systems 29 End Users 29 General Best Practices 29 Define the Project Goals 30 Know the Basic Rules 30 Follow Mature, Open, and WellSupported Web Standards 31 Deal with CrossBrowser Issues 32 Assume Support for HTML Only 33 Name and Group Folders and Files Consistently 36 Maintain a Tidy Code Base 37 Design Your Code for Performance 37 Don’t Use Technology for Its Own Sake 37 Markup Best Practice: Semantic HTML 38 Learn the HTML Tags 38 Start with a Document Type Definition 40 DOCTYPE Switching 40 DTD Selection 40 DTD Validation 41 How Do You Put the X in XHTML? 41 Well-Formed Documents 42 Element Prohibitions 42 Put Best Practice into Practice 43 Write Code That’s Neat and Tidy 43 Cut Down on Comments 43 Use Conditional Comments for IE 44 Set the Tag Correctly 45 Specify the Content Type 45 Set the Page Title 46 Separate Presentation, Content, and Behavior 46 Add a Wrapper Element to the Whole Document 47 Help CSS and JavaScript Target Individual Pages 47 Name Your ID and Class Attributes Consistently 48 Order Your Content Correctly 48 Separate Foreground Images from Backgrounds 49 Use Tables Properly 49 Improve Your Forms 50 Avoid Using Frames 51 Accessibility Guidelines for Web Content 52 Don’t Be Fooled by Access Keys 52 Don’t Be Fooled by Tab Indexes 52 Don’t Rely on PlugIns 53 Add Extra Semantics Where You Can 53 Formatting Best Practice: CSS 54 Regarding PixelPerfect Reproduction of Designs 54 W3C CSS Standards 55 Guidelines for Style Sheets 55 Separate Common Style Rules 55 Understand Cascade and Specificity 56 Think About the Printer 58 Format Your Style Rules 59 Apply Multiple Class Names to a Single Page Element 60 Reset the Browser’s Default Styles 60 Master Shorthand Style Rules 62 Accessibility Guidelines for Styles 63 Hide Content from CSSCapable Browsers 63 Move Content Blocks to Maintain Correct Markup Source Order 64 Use Relative Font Sizes 64 Comment Blocks 65 Browser WorkArounds 66 Localization Considerations 67 Structuring Your Folders, Files, and Assets 67 Readable URLs 67 File and Folder Naming 68 File Encoding 68 Organizing Assets 68 Image Guidelines 69 Multimedia Guidelines 70 Setting Up Your Development Environment 70 Writing Your Files: Integrated Development Environments 70 Storing Your Files: Version Control Systems 71 Testing Your Pages: Browsers and Development Tools 71 Summary 73 JavaScript for rich Internet applications 75 Coding Style Guidelines 75 Use Consistent Formatting 75 Use Braces and Brackets 76 Add Meaning with Letter Casing 77 Use Descriptive Variable and Function Names 77 Maintain Short Function Blocks 78 Use Comments As Documentation with ScriptDoc 80 Mark Remaining Tasks with TODO 81 Professional JavaScript Programming 81 Avoid Solving Nonexistent Problems 81 Use the Document Object Model 82 Dynamically alter CSS properties 83 Manipulate elements and their Contents 83 Don’t Mix JavaScript and HTML 84 Separate Style from Code 84 Chain Function Calls 85 Write Bulletproof Code 85 handle Fatal exception errors Gracefully 85 Define Custom exceptions 86 and Finally . . . 87 Code with Localization in Mind 87 Object-Oriented JavaScript 88 Objects, Classes, and Constructors 88 What Is an Object? 88 What Is a Class? 88 Objects as Instances of Classes 89 Constructors 89 properties 90 Methods 90 the prototype Keyword 91 Singletons 91 Inheritance: Creating New Classes from Existing Ones 92 encapsulation: each Class Doing What It Does Best 93 polymorphism: redefining Inherited properties and Methods 93 The this Keyword 95 Access to Properties and Methods 97 Object Literals and JavaScript Object Notation 99 Using Object Literals When Creating Classes 100 Using Object Literals as Inputs to Functions 100 Creating Namespaces and Hierarchies 101 Libraries and Frameworks 101 Selecting a Library 102 Building a JavaScript Library 103 Detecting When the DOM Is available 103 handling events in the Browser 104 Loading Content on Demand with ajax 109 Using Utility Functions 113 handling CSS and Styles 116 Locating elements Within the page 119 Completing the Library 120 Building RIAs 121 Structuring the Application 121 Managing Two Sets of HTML 124 Using Design Patterns 125 the Model-ViewController pattern 125 the Observer pattern 128 Testing and TestDriven Development 131 Using ThirdParty Scripts 134 Summary 135 Understanding the Web Browser 139 Engines: The Browser’s Powerhouse 139 The Rendering and JavaScript Engines 139 JavaScript Engine Performance Benchmarking 140 Anatomy of a Web Page Request 143 HTTP: The Communication Standard Behind the Web 143 An hTTP Request Message 144 An hTTP Response Message 147 HTTP Status Codes 149 200+ (Success) 149 300+ (Redirection) 149 400+ (Client error) 150 500+ (Server error) 151 How Messages Are Transmitted 151 IP Addresses: Phone Numbers of the Internet 151 Packets: Chunks of Data 152 Routes and Routers: The Switchboard of the Internet 153 Loading Order of an HTML Page 154 Page Performance 155 Viewing the Performance of a Page 155 Identifying Potential Bottlenecks in Performance 156 engine horsepower 156 User’s Upload Speeds 157 Parallel Connection Limits 157 Choice of Image Format 157 Unnecessary Content 157 Cache Settings 158 Uncompressed Text Files and extra Whitespace 158 Summary 158 performance tweaking 159 Is Performance Really an Issue? 159 Tweaking Your Web Server for Performance 161 Use Separate Domain Names for External Assets 161 Use a Content Delivery Network 161 Send HTML to the Browser in Chunks 162 Flushing the Buffer with php 163 Flushing the Buffer with aSp.Net/C# 163 Flushing the Buffer with JSp 163 Customize HTTP Headers to Force Browser Caching 164 Compress the Output from the Server 165 enabling Compression in apache Web Server 166 enabling Compression in IIS 166 enabling Compression in tomcat 166 Tweaking HTML for Performance 166 Shrink Your HTML File Size with HTML Tidy 167 Reference JavaScript Files at the End of Your HTML 167 Reduce the Number of HTTP Requests 168 Good Division and Structure 169 Combine Files 169 Don’t Load Every Asset from Your Home Page 170 Reduce Domain Name Lookups 170 Split Components Across Domains 171 Avoid Linking to Redirects 172 Reduce the Number of HTML Elements 172 Don’t Link to Nonexistent Files 173 Reduce the Size of HTTP Cookies 173 Tweaking Your Style Sheets for Performance 174 Shrink Your CSS File Size with CSSTidy 174 Don’t Use the @import Command 174 Speed Up Table Layouts 174 Avoid CSS Filters and Expressions in IE 175 Use Shorthand Values 175 Colors 176 Margins and padding 176 Borders 177 Backgrounds 178 Fonts 178 Lists 179 Use the CSS Sprite Technique 179 Avoid Inefficient CSS Selectors 183 Tweaking Your Images for Performance 183 Understand Image File Formats 184 GIF Format 184 JpeG Format 185 pNG Format 185 Optimize PNG Images 186 Don’t Forget the Favicon 187 Tweaking Your JavaScript for Performance 187 Shrink Your JavaScript File Using Dojo ShrinkSafe 187 Access JavaScript Libraries Through CDNs 188 Timing Is Everything 188 Boost Core JavaScript Performance 190 Use a Memoizer 190 Use efficient String Concatenation 191 Use regular expressions 192 Loop Faster and More efficiently 192 Coming Soon: Background Web Worker processes 193 Improve Ajax Performance 194 Use JSON Format for responses 194 Use JSONp with the tag 194 Consolidate Server requests and responses 196 Improve DOM Performance 196 Minimize DOM access 197 Use DocumentFragment Objects 197 plug Memory Leaks 198 Use event Delegates 199 Change Class, Not Style, When Updating CSS 200 Duplicate existing Nodes rather than Create New Ones 201 append elements to the page as htML Strings 202 Summary 202 Smoke and Mirrors: perceived responsiveness 203 Providing Prompt Visual Feedback 203 Time It Right 203 Use CSS Pseudo-Classes on Hyperlinks 205 Let the User Know the Form Is Being Submitted 205 Change the Mouse Pointer 206 Use a Web 2.0–Style Animated Indicator 207 Show a Progress Bar 207 Handling LongRunning Scripts 208 Divide Long-Running Scripts into Chunks 209 Use a Timer to Run Code Blocks Multiple Times 211 Anticipating Your Site Visitors’ Needs 213 Preload Content 213 Load Navigation Levels Efficiently 214 Catch Mouse Clicks Early 216 Summary 216 Beautiful Typography 219 The Challenge 219 The Basic Anatomy of a Font 220 Using Static Images for Text 222 Generating Images for Text Dynamically 223 Using CSS to Embed Font Files Directly 223 CSS Web Fonts 224 Problems with embedded Font Files 225 Having the Server Generate Text Images 226 Dynamic Image Generation in PhP 226 Dynamic Image Generation in ASP.NeT (C#) 228 Dynamic Image Generation in Java/JSP 231 extending the ServerScript Code Routines 233 Generating Text in Custom Typefaces Using Flash 234 Generating Text Using Vector Graphics 235 Using Reusable Custom Font Components 235 Text2PNG 235 Sample Text2PNG Usage 236 Replacing a Single element 237 Replacing All Content Within a Specific Named Tag 237 Replacing the Contents of All Child elements 238 Applying extra Text Formatting with Text2PNG 238 Text2PNG Appraisal 238 Scalable Inman Flash Replacement 239 Sample sIFR Usage 240 Applying extra Text Formatting with sIFR 242 sIFR Appraisal 242 Facelift Image Replacement 243 Sample FLIR Usage 243 FLIR Appraisal 244 Typeface.js 245 Sample Typeface.js Usage 245 Typeface.js Appraisal 246 Summary 247 Multimedia playback 249 Handling Accessibility 249 Using Reusable Audio Playback Components 250 The SoundManager Component 250 the SoundManager Feature Set 254 SoundManager appraisal 254 Playing Audio Files Without Flash 255 Using Reusable Video Playback Components 256 YouTube Chromeless Player 259 the SWFObject Component 260 Youtube Chromeless player Implementation 262 Youtube Chromeless player appraisal 265 JW FLV Player 265 JW FLV player Implementation 266 JW FLV player Feature Set 269 JW FLV player appraisal 269 The Future: Audio and Video in HTML 5 270 The and Tags 270 JavaScript API 271 Current Adoption Level 272 Summary 272 Form Controls 273 Customizing Existing Form Controls 273 Buttons 273 Button Style Customization 274 an alternative to Imaget ype Form Buttons 275 Text Fields 277 a NumbersOnly text Field 278 an e-Mail address Field 278 File Upload Controls 279 Adding New Types of Form Controls 283 A Calendar Widget for Date Selection 283 Creating Utility Methods for Dates 285 Building the Calendar 288 testing the Calendar Control 301 Slider Control 305 Building the Slider 305 testing the Slider Control 317 Using Reusable Form Components 320 SWFUpload: Multiple File Uploads with Progress Bars 320 SWFUpload Sample Usage 321 SWFUpload appraisal 325 TinyMCE: Rich Text Editing 325 tinyMCe Sample Usage 326 tinyMCe Feature Set 327 tinyMCe appraisal 327 Validating Forms 328 Summary 329 Offline Storage—When the Lights Go Out 331 Using Cookies to Store Data 331 Creating Cookies 332 The Downside of Cookies 334 Using Internet Explorer’s Data Store 335 Introducing the Data Storage APIs 338 The Local Storage API 338 Mozilla’s Global Storage API 339 Client-Side Database Storage API 341 Storing Data Using Flash Shared Objects 346 Creating a CrossBrowser Local Data Storage API 347 Using a Reusable Offline Storage Component 354 Summary 354 Binary ajax 355 Plain Text Files vs. Binary Files 355 Reading Binary Files with Ajax 355 Extracting Image Data from Photo Files 363 Understanding the EXIF Format 364 the JpeG and eXIF headers 364 Image File Directories and tags 364 Reading EXIF Data Using JavaScript 365 Displaying EXIF Data from a File 375 Summary 380 Drawing in the Browser 381 Creating Scalable Vector Graphics 381 Creating SVG Image Files 382 Specifying SVG Within HTML 383 Specifying SVG Through JavaScript 385 Drawing with Vector Markup Language 386 Building Dynamic Graphs with a Reusable Drawing Library 387 Using the HTML 5 Tag 395 Summary 397 accessibility in rich Internet applications 399 Whose Needs Are We Meeting? 399 Users Using Assistive Technology 399 Users on Mobile Devices 399 Users Without a Mouse 400 Accessibility for All 401 Proper Navigation with the Back and Forward Buttons 401 Device-Independent JavaScript 407 Device-Independent Events 407 Device-Independent Event Delegation 408 Updated Content Alerts and Focus 410 Web Accessibility Initiative: Accessible Rich Internet Applications (WAI-ARIA) 414 Roles 414 States and Properties 415 Focus Management 417 Keyboard Interaction with ARIA Widgets 418 WAI-ARIA Examples 418 Marking Up page Structure Using roles, States, and properties 418 Dynamically Loading Content via ajax 420 Making a progress Bar More accessible 423 Validation 423 Testing 424 Summary 425 Index 427 Prelims ......Page 1 Contents at a Glance......Page 7 Contents......Page 9 About the Author......Page 17 About the Technical Reviewer......Page 19 Acknowledgments......Page 21 Introduction......Page 23 Best Practice Overview......Page 27 Web Developers......Page 28 General Best Practices......Page 29 Know the Basic Rules......Page 30 Follow Mature, Open, and WellSupported Web Standards......Page 31 Deal with CrossBrowser Issues......Page 32 Assume Support for HTML Only......Page 33 Name and Group Folders and Files Consistently......Page 36 Don’t Use Technology for Its Own Sake......Page 37 Learn the HTML Tags......Page 38 DTD Selection......Page 40 How Do You Put the X in XHTML?......Page 41 Element Prohibitions......Page 42 Cut Down on Comments......Page 43 Use Conditional Comments for IE......Page 44 Specify the Content Type......Page 45 Separate Presentation, Content, and Behavior......Page 46 Help CSS and JavaScript Target Individual Pages......Page 47 Order Your Content Correctly......Page 48 Use Tables Properly......Page 49 Improve Your Forms......Page 50 Avoid Using Frames......Page 51 Don’t Be Fooled by Tab Indexes......Page 52 Add Extra Semantics Where You Can......Page 53 Regarding PixelPerfect Reproduction of Designs......Page 54 Separate Common Style Rules......Page 55 Understand Cascade and Specificity......Page 56 Think About the Printer......Page 58 Format Your Style Rules......Page 59 Reset the Browser’s Default Styles......Page 60 Master Shorthand Style Rules......Page 62 Hide Content from CSSCapable Browsers......Page 63 Use Relative Font Sizes......Page 64 Comment Blocks......Page 65 Browser WorkArounds......Page 66 Readable URLs......Page 67 Organizing Assets......Page 68 Image Guidelines......Page 69 Writing Your Files: Integrated Development Environments......Page 70 Testing Your Pages: Browsers and Development Tools......Page 71 Summary......Page 73 Use Consistent Formatting......Page 75 Use Braces and Brackets......Page 76 Use Descriptive Variable and Function Names......Page 77 Maintain Short Function Blocks......Page 78 Use Comments As Documentation with ScriptDoc......Page 80 Avoid Solving Nonexistent Problems......Page 81 Use the Document Object Model......Page 82 Manipulate elements and their Contents......Page 83 Separate Style from Code......Page 84 handle Fatal exception errors Gracefully......Page 85 Define Custom exceptions......Page 86 Code with Localization in Mind......Page 87 What Is a Class?......Page 88 Constructors......Page 89 Methods......Page 90 Singletons......Page 91 Inheritance: Creating New Classes from Existing Ones......Page 92 polymorphism: redefining Inherited properties and Methods......Page 93 The this Keyword......Page 95 Access to Properties and Methods......Page 97 Object Literals and JavaScript Object Notation......Page 99 Using Object Literals as Inputs to Functions......Page 100 Libraries and Frameworks......Page 101 Selecting a Library......Page 102 Detecting When the DOM Is available......Page 103 handling events in the Browser......Page 104 Loading Content on Demand with ajax......Page 109 Using Utility Functions......Page 113 handling CSS and Styles......Page 116 Locating elements Within the page......Page 119 Completing the Library......Page 120 Structuring the Application......Page 121 Managing Two Sets of HTML......Page 124 the Model-ViewController pattern......Page 125 the Observer pattern......Page 128 Testing and TestDriven Development......Page 131 Using ThirdParty Scripts......Page 134 Summary......Page 135 The Rendering and JavaScript Engines......Page 139 JavaScript Engine Performance Benchmarking......Page 140 HTTP: The Communication Standard Behind the Web......Page 143 An hTTP Request Message......Page 144 An hTTP Response Message......Page 147 300+ (Redirection)......Page 149 400+ (Client error)......Page 150 IP Addresses: Phone Numbers of the Internet......Page 151 Packets: Chunks of Data......Page 152 Routes and Routers: The Switchboard of the Internet......Page 153 Loading Order of an HTML Page......Page 154 Viewing the Performance of a Page......Page 155 engine horsepower......Page 156 Unnecessary Content......Page 157 Summary......Page 158 Is Performance Really an Issue?......Page 159 Use a Content Delivery Network......Page 161 Send HTML to the Browser in Chunks......Page 162 Flushing the Buffer with JSp......Page 163 Customize HTTP Headers to Force Browser Caching......Page 164 Compress the Output from the Server......Page 165 Tweaking HTML for Performance......Page 166 Reference JavaScript Files at the End of Your HTML......Page 167 Reduce the Number of HTTP Requests......Page 168 Combine Files......Page 169 Reduce Domain Name Lookups......Page 170 Split Components Across Domains......Page 171 Reduce the Number of HTML Elements......Page 172 Reduce the Size of HTTP Cookies......Page 173 Speed Up Table Layouts......Page 174 Use Shorthand Values......Page 175 Margins and padding......Page 176 Borders......Page 177 Fonts......Page 178 Use the CSS Sprite Technique......Page 179 Tweaking Your Images for Performance......Page 183 GIF Format......Page 184 pNG Format......Page 185 Optimize PNG Images......Page 186 Shrink Your JavaScript File Using Dojo ShrinkSafe......Page 187 Timing Is Everything......Page 188 Use a Memoizer......Page 190 Use efficient String Concatenation......Page 191 Loop Faster and More efficiently......Page 192 Coming Soon: Background Web Worker processes......Page 193 Use JSONp with the tag......Page 194 Improve DOM Performance......Page 196 Use DocumentFragment Objects......Page 197 plug Memory Leaks......Page 198 Use event Delegates......Page 199 Change Class, Not Style, When Updating CSS......Page 200 Duplicate existing Nodes rather than Create New Ones......Page 201 Summary......Page 202 Time It Right......Page 203 Let the User Know the Form Is Being Submitted......Page 205 Change the Mouse Pointer......Page 206 Show a Progress Bar......Page 207 Handling LongRunning Scripts......Page 208 Divide Long-Running Scripts into Chunks......Page 209 Use a Timer to Run Code Blocks Multiple Times......Page 211 Preload Content......Page 213 Load Navigation Levels Efficiently......Page 214 Summary......Page 216 The Challenge......Page 219 The Basic Anatomy of a Font......Page 220 Using Static Images for Text......Page 222 Using CSS to Embed Font Files Directly......Page 223 CSS Web Fonts......Page 224 Problems with embedded Font Files......Page 225 Dynamic Image Generation in PhP......Page 226 Dynamic Image Generation in ASP.NeT (C#)......Page 228 Dynamic Image Generation in Java/JSP......Page 231 extending the ServerScript Code Routines......Page 233 Generating Text in Custom Typefaces Using Flash......Page 234 Text2PNG......Page 235 Sample Text2PNG Usage......Page 236 Replacing All Content Within a Specific Named Tag......Page 237 Text2PNG Appraisal......Page 238 Scalable Inman Flash Replacement......Page 239 Sample sIFR Usage......Page 240 sIFR Appraisal......Page 242 Sample FLIR Usage......Page 243 FLIR Appraisal......Page 244 Sample Typeface.js Usage......Page 245 Typeface.js Appraisal......Page 246 Summary......Page 247 Handling Accessibility......Page 249 The SoundManager Component......Page 250 SoundManager appraisal......Page 254 Playing Audio Files Without Flash......Page 255 Using Reusable Video Playback Components......Page 256 YouTube Chromeless Player......Page 259 the SWFObject Component......Page 260 Youtube Chromeless player Implementation......Page 262 JW FLV Player......Page 265 JW FLV player Implementation......Page 266 JW FLV player appraisal......Page 269 The and Tags......Page 270 JavaScript API......Page 271 Summary......Page 272 Buttons......Page 273 Button Style Customization......Page 274 an alternative to Imaget ype Form Buttons......Page 275 Text Fields......Page 277 an e-Mail address Field......Page 278 File Upload Controls......Page 279 A Calendar Widget for Date Selection......Page 283 Creating Utility Methods for Dates......Page 285 Building the Calendar......Page 288 testing the Calendar Control......Page 301 Building the Slider......Page 305 testing the Slider Control......Page 317 SWFUpload: Multiple File Uploads with Progress Bars......Page 320 SWFUpload Sample Usage......Page 321 TinyMCE: Rich Text Editing......Page 325 tinyMCe Sample Usage......Page 326 tinyMCe appraisal......Page 327 Validating Forms......Page 328 Summary......Page 329 Using Cookies to Store Data......Page 331 Creating Cookies......Page 332 The Downside of Cookies......Page 334 Using Internet Explorer’s Data Store......Page 335 The Local Storage API......Page 338 Mozilla’s Global Storage API......Page 339 Client-Side Database Storage API......Page 341 Storing Data Using Flash Shared Objects......Page 346 Creating a CrossBrowser Local Data Storage API......Page 347 Summary......Page 354 Reading Binary Files with Ajax......Page 355 Extracting Image Data from Photo Files......Page 363 Image File Directories and tags......Page 364 Reading EXIF Data Using JavaScript......Page 365 Displaying EXIF Data from a File......Page 375 Summary......Page 380 Creating Scalable Vector Graphics......Page 381 Creating SVG Image Files......Page 382 Specifying SVG Within HTML......Page 383 Specifying SVG Through JavaScript......Page 385 Drawing with Vector Markup Language......Page 386 Building Dynamic Graphs with a Reusable Drawing Library......Page 387 Using the HTML 5 Tag......Page 395 Summary......Page 397 Users on Mobile Devices......Page 399 Users Without a Mouse......Page 400 Proper Navigation with the Back and Forward Buttons......Page 401 Device-Independent Events......Page 407 Device-Independent Event Delegation......Page 408 Updated Content Alerts and Focus......Page 410 Roles......Page 414 States and Properties......Page 415 Focus Management......Page 417 Marking Up page Structure Using roles, States, and properties......Page 418 Dynamically Loading Content via ajax......Page 420 Validation......Page 423 Testing......Page 424 Summary......Page 425 Index......Page 427
Pro JavaScript RIA Techniques: Best Practices, Performance, and Presentation shows you how you can build JavaScript RIAs (rich Internet applications) with compelling user interfaces and great performance.
With the best practices and optimization techniques you’ll learn in this book, you can optimize performance without sacrificing a rich user interface. Using a combination of innovative ideas and intelligent use of HTML, CSS, JavaScript, and plugins, this book shows you how to make decisions based on best web standard development practices and realworld browser data.
Through practical examples, you’ll see how to optimize both design and performance with an eye toward future enhancements and efficient maintenance.
- Starting with the essential principles and techniques of semantic markup, build efficient, responsive web applications based on web standard best practices and realworld experience.
- Apply practical techniques and see how to reuse examples of broadly relevant page components to improve the interface and performance of existing sites.
- Explore ways to push the boundaries of the possible with existing browser technology.
What you’ll learn - Best practices for building web applications using JavaScript and web standards
- Optimization techniques for high performance in browsers
- How to create richer user interfaces
- Advanced Ajax techniques
- How to optimize graphic performance by drawing in the browser with SVG
- Integrating accessibility into rich web applications
Who this book is for This book is aimed at web developers and designers who need to improve the user experience of their sites by making their code more efficient and their sites more responsive, and incorporating more complexity all at the same time. It is for Internet professionals ready to go beyond Web 2.0 to a newer, more streamlined vision of rich user experiences.
Table of Contents
- Building a Solid Foundation
- JavaScript for Rich Internet Applications
- Understanding the Web Browser
- Performance Tweaking
- Smoke and Mirrors: Perceived Responsiveness
- Beautiful Typography
- Multimedia Playback
- Form Controls
- Offline Storage—When the Lights Go Out
- Binary Ajax
- Drawing in the Browser
- Accessibility in Rich Internet Applications
Pro JavaScript RIA Techniques: Best Practices, Performance, and Presentation shows you how you can build JavaScript RIAs (Rich Internet Applications) with compelling user interfaces and great performance. With the best practices and optimization techniques you ll learn in this book, you can optimize performance without sacrificing a rich user interface. Using a combination of innovative ideas and intelligent use of HTML, CSS, JavaScript, and plug ins, this book shows you how to make decisions based on best web standard development practices and real world browser data. Through practical exampl