The JavaScript Anthology 101 Essential Tips, Tricks & Hacks docx

158 394 0
The JavaScript Anthology 101 Essential Tips, Tricks & Hacks docx

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

[...]... advocate!), but the reasons aren’t all that important: some users simply don’t have JavaScript, and we should accommodate them There’s no way to quantify the numbers of users who fall into this category, because detecting JavaScript support from the server is notoriously unreliable, but the figures I’ve seen put the proportion of users who have JavaScript switched off between 5% and 20%, depending on whether... means that if JavaScript is not supported, the browser can naturally fall back on, or “degrade” to, non-scripted functionality Order the print version of this book to get all 588 pages! 5 Chapter 1: Getting Started with JavaScript and the Sony PSP, as well as legacy JavaScript browsers such as Opera 5 and Netscape 4 The last point in the list above is arguably the least likely (apart from other developers... becoming interested in—and impressed by—what was once the domain of specialists Browser vendors and other technology companies are taking another look at the potential of this powerful language, as the line between the Web and the desktop becomes increasingly blurred JavaScript is a key component in the development of a raft of new applications, and there’s never been a better time to take an interest... in this case the “client” refers to the end-user’s web browser, in which JavaScript is interpreted and run This distinguishes it from server-side languages like PHP and ASP, which run on the server and send static data to the client Since JavaScript does not have access to the server environment, there are many tasks that, while trivial when executed in PHP, simply cannot be achieved with JavaScript: ... you stay away from those kinds of scripts, the issue will come up only rarely 1 Host objects are things like window and screen, which are provided by the environment rather than the language itself 4 Order the print version of this book to get all 588 pages! JavaScript Best Practices JavaScript Best Practices JavaScript best practices place a strong emphasis on the question of what you should do for people... AJAX applications, to see how they behave with screen readers Chapter 17: Using JavaScript with Flash In this chapter, we look at the narrow alliance between these two technologies, learning to detect whether a user has the Flash plugin, and mastering communication between JavaScript and Flash Chapter 18: Building Web Applications with JavaScript This chapter delves into the exciting area of online application... although it was originally called LiveScript The growing popularity of another language, Java, prompted Netscape to change the name in an attempt to cash in on the connection, as JavaScript provided the ability to communicate between the browser and a Java applet But as the language was developed both by Netscape, in its original form, and by Microsoft, in the similar-but-different JScript implementation,... having to edit the HTML, and since the document itself does not rely on or refer to the scripting at all, browsers that don’t understand JavaScript will not be affected by it This solution also provides the benefits of reusability, because we can bind the same functions to other elements as needed, without having to edit the HTML This solution hinges on our ability to access elements through the DOM, which... combining them, when we look at the HTML we’re less likely to forget that its core function should be to describe the content of the page, independent of any scripting Andy Clarke refers to the web standards trifle,4 which is a useful analogy, A trifle looks the way a good web site should: when you look at the bowl, you can see all the separate layers that make up the dessert The opposite of this might... insertion Whenever the interpreter finds two code fragments that are separated by one or more line breaks, and those fragments wouldn’t make sense if they were on a single line, the interpreter treats them as though a semicolon existed between them By a similar mechanism, the braces that normally surround the code to be executed in if-else statements may be inferred from the syntax, even though they’re not . with JavaScript 467 19. Object Orientation in JavaScript 515 20. Keeping up the Pace 565 The JavaScript Anthology 101 Essential Tips, Tricks & Hacks by. Cameron Adams’s book, The JavaScript Anthology: 101 Essential Tips, Tricks & Hacks, published by SitePoint. This excerpt includes the Summary of Contents,

Ngày đăng: 08/03/2014, 20:20

Từ khóa liên quan

Mục lục

  • The JavaScript Anthology

  • Summary of Contents

  • Table of Contents

  • Preface

    • Who Should Read this Book?

    • What’s in this Book?

    • The Book’s Web Site

      • The Code Archive

      • Updates and Errata

      • The SitePoint Forums

      • The SitePoint Newsletters

      • Your Feedback

      • Acknowledgements

      • 1. Getting Started with JavaScript

        • JavaScript Defined

        • JavaScript’s Limitations

          • Security Restrictions

          • JavaScript Best Practices

          • Providing for Users who Don’t Have JavaScript (Progressive Enhancement)

          • Separating Content from Behavior (Unobtrusive Scripting)

          • Using Braces and Semicolons (Consistent Coding Practice)

          • Adding a Script to a Page

            • Putting HTML Comments Around Code

            • The language Attribute

            • Getting Multiple Scripts to Work on the Same Page

Tài liệu cùng người dùng

Tài liệu liên quan