JavaScript Essentials

By Neil Smyth
Before JavaScript was created, a typical web browsing experience consisted largely of displaying static pages of information. Any type of user interaction with a web page usually involved the browser sending information back to the web server where some type of server based script or other program would validate the user's data input. The server would then send back either a static error page if the user had entered invalid data or, assuming successful validation, return a static page to the web browser containing the results of the transaction. In addition, the lack of a mechanism to implement dynamic web page content and behavior dictated that an entirely new web page be loaded in order to display new information.
It quickly became clear that a way of performing "client-side" or "web browser-side" processing was needed. The original intent for JavaScript, therefore, was to address this need by facilitating such tasks as validating user input before it is transmitted to the web server, and creating dynamic web page content and layouts independently of the web server (for example, displaying different text depending on a user's actions within the page).
JavaScript met and, indeed, exceeded these requirements by providing an extremely flexible and intuitive scripting language. The problem today is that, as with any useful technology, JavaScript has been used in ways never anticipated by its original authors. As a result, the potential uses of JavaScript have grown far beyond the needs of the average person looking to add dynamic behavior to web pages. The result of this is that JavaScript book authors also feel the need to cover every possible capability of JavaScript, often to the extent that the average JavaScript reference book now runs to over 1,000 pages.
The purpose of this book, therefore, is to provide the essentials of JavaScript so that anyone with a web site can use this powerful scripting language quickly and effectively without having to learn things that, whilst within the capabilities of JavaScript, aren't actually needed by the average web designer. That said this book does not take any shortcuts. It provides detailed and in depth knowledge of all aspects of JavaScript from language basics through to advanced topics.
This book is designed to provide a detailed and comprehensive, yet easy to follow, guide to developing powerful, dynamic web pages using JavaScript. It could be said that the object of JavaScript Essentials is to provide you with everything you need to use JavaScript, and nothing that you don't.
Read More/Download

Simply JavaScript

By Kevin Yank and Cameron Adams
What’s Covered in this Book?
  • Chapter 1: The Three Layers of the Web: A big part of learning JavaScript is learning when it’s the right tool for the job, and when ordinary HTML and CSS can offer a better solution. Before we dive into learning JavaScript, we’ll take a little time to review how to build web sites with HTML and CSS, and see just how JavaScript fits into the picture.
  • Chapter 2: Programming with JavaScript: JavaScript is a programming language. To work with it, then, you must get your head around the way computer programs work—which to some extent means learning to think like a computer. The simple concepts introduced in this chapter—statements, variables, expressions, loops, functions, and objects—are the building blocks for every JavaScript program you’ll ever write.
  • Chapter 3: Document Access: While certain people enjoy writing JavaScript code for its own sake, you wouldn’t want to run into them in a dark alley at night. As a well-adjusted web developer,you’ll probably want to use JavaScript to make changes to the contents of yourweb pages using the Document Object Model (DOM). Lucky for you, we wrote a whole chapter to show you how!
  • Chapter 4: Events: By far the most eventful portion of this book (ha ha ha … I slay me), this chapter shows you how to write JavaScript programs that will respond to the actions of your users as they interact with a web page. As you’ll see, this can be done in a number of ways, for which varying degrees of support are provided by current browsers.
  • Chapter 5: Animation: Okay, okay. We can talk all day about the subtle usability enhancements that JavaScript makes possible, but we know you won’t be satisfied until you can make things swoosh around the page. In this chapter, you’ll get all the swooshing you can handle.
  • Chapter 6: Form Enhancements: I know what you’re thinking: forms are boring. Nobody leaps out of bed in the morning, cracks their knuckles, and shouts, “Today, I’m going to fill in some forms!” Well, once you trick out your forms with the enhancements in this chapter, they just might. Oh, and just to spice up this chapter a bit more, we’ll show you how to make an element on your page draggable.
  • Chapter 7: Errors and Debugging: When things go wrong in other programming languages, your computer will usually throw a steady stream of error messages at you until you fix the problem. With JavaScript, however, your computer just folds its arms and gives you alook that seems to say, “You were expecting, maybe, something to happen?” No, English is not your computer’s first language. What did you expect? It was made in Taiwan. In this chapter, we’ll show you how to fix scripts that don’t behave the way they should.
Read More/Download

JavaScript cheat sheet

The JavaScript cheat sheet is designed to act as a reminder and reference sheet, listing methods and functions of JavaScript. It includes reference material for regular expressions in JavaScript, as well as a short guide to the XMLHttpRequest object. A description of what is on the cheat sheet follows, or if you are impatient, you can go straight to the full size JavaScript cheat sheet.
JavaScript has a huge number of methods and functions available. The cheat sheet lists these in various sections. On the left is a list of simple methods in JavaScript. On the right are DOM methods. Functions are in their own section at the bottom of the page.
The XMLHttpRequest object is relatively new to JavaScript. It is used to make requests and receive responses in XML format from a server, allowing developers to create interactivity with the server without the need for page refreshes (see the "Live Search" on the right of this page for an example). This section of the cheat sheet is a short reference to the object, containing a list of useful methods and properties, the syntax for creating the object in different browsers, and the various readyState values.
Read More/Try It

Followers