XForms Essentials

by Micah Dubinko
You should read this book if you want to:
  • Create XForms files in a text or XML editor
  • Convert existing forms (electronic or paper) to XForms
  • Collect XML data from users in a user-friendly way
  • Reduce the amount of JavaScript needed within browser interfaces
  • Increase the security and reliability of your current information system by combining client-side and server-side checks into a common code base
  • Understand how to create interactive web sites using the latest standard technology

This book is organized into three divisions. The first gives a general introduction to web forms, including information on the history and basic construction of forms. The second section serves as a kind of reference manual to the XForms specification. The third section offers additional hints, guidelines, and techniques for working with XForms.

If you simply want to fill out a form, you need only acquire the appropriate software or browser plug-in. There's no need for you to know what's going on behind the scenes unless you wish to satisfy your commendable intellectual curiosity.

If you wish to create forms with a designer program that has XForms export capability, just read that program's documentation to learn how to use that program feature. XForms goes to great lengths to make the fill-out experience intuitive; reading instructions is not required.

Click to Read More

JavaScript Advanced Tutorials

Latest Tutorials
  • JavaScript and memory leaks - If you're not careful, your JavaScript code may leak memory and sometimes even bring the visitor's browser to its knees. This tutorial looks at different leak patterns in JavaScript and how to fix them.
  • JavaScript Closures 101- they're not magic - Morris Johns explains JavaScript closures, a powerful yet often bewildering concept, in a gentle, step by step fashion.
  • Conditional Compilation of JScript/ JavaScript in IE - IE supports a little known feature called conditional compilation that selectively compiles any block of JScript or JavaScript depending on your script logic. Think of it as the absolute form of object detection.
  • External JavaScript and PHP - External JavaScript can reference not just .js files, but PHP scripts as well. See how this is done, and the wonderful possibilities linking PHP to JavaScript bring.
  • Changing Select element content on the fly - This tutorial explains how to change a select element's content using JavaScript, from adding new options to modifying and deleting them. It also shows how to create a 2 level interdependent select list.
  • Determining cookie support in client's browser - If your script relies on JavaScript cookies to store and persist information, it's a good idea to always first make sure the user's browser has cookies enabled. This tutorial shows you how to perform this detection.
    Sorting and filtering a Tabular Data ControlA Tabular Data Control can easily be sorted and filtered before its data is shown on the page. The following two tutorials examine this:- (1) Sorting a Tabular Data Control (2) Filtering a Tabular Data Control
  • Introduction to Tabular Data Control (IE) - Tabular Data Control is a Microsoft ActiveX control that comes pre-installed with all versions of IE4+. This useful control allows you to access, display, and sort ASCII information stored on the server end, such as a .txt file. In other words, it creates a simple client side "database." Learn about TDC and how to use JavaScript to manipulate it in this tutorial.
  • Introductory Guide to Regular Expressions - Always wanted to learn about Regular Expressions in JavaScript? With this comprehensive yet gentle tutorial on the subject, you'll be on your way to slashing and validating string input using Regular Expressions in no time!
  • Programmer's Guide to Regular Expressions - Concise, to-the-point tutorial on Regular Expressions with sections on more advanced aspects of the feature.
  • JavaScript and Object Oriented Programming (OOP) - JavaScript may not be known for its object oriented properties, but it does support most of the features required to be considered an Object Oriented language. See how to write OOP code in JavaScript.
  • Formatting numbers for decimals and significant digits - Need to display a number in currency format? How about a number that is x digits in length? See how to easily, using two new methods of JavaScript 1.5+.

Click to Read More

JavaScript Authoring Info

By John Russell
JavaScript (aka ECMAScript) is a relatively easy way to make your website visually attractive to clients and other viewers by adding interactivity and dynamics to HTML pages. This page explains why one would use JavaScript in their HTML website design. JavaScript can also be used as a basis for writing utility programs that are platform independent. Programming concepts learned in JavaScript can be rolled over into Java or any modern object oriented language. This page also has links to JavaScript code repositories and references for those who prefer not to reinvent wheels. And finally for those who do prefer to roll their own there are my programming notes, some introductory tutorials, small projects, larger projects and form projects pages.
Why Use JavaScript
  • Why should a webpage author use JavaScript in addition to HTML?
  • Javascript adds user interactivity.
  • Javascript enhances visual displays.
  • Javascript allows client-side user form validation.
  • Javascript provides more seamless integration with user plug-ins.
  • Javascript allows access to some system information that HTML does not.

Language Design Issues

  • Because JavaScript uses a high-end approach to security (leaving lapses in the domain of the browser) there are some applications that it is not appropriate for:
  • JavaScript does not have user file access. You must use cut/paste techniques to input or save data.
  • JavaScript does not have a print method. You must create an HTML page and use the browser menu to print.
  • JavaScript cannot run programs on the host machine unless it is through browser plug-ins or associations allowed within the browser.
  • JavaScript has no access to the user environment other than what the browser provides. Hence no access to the Windows registry is possible.
  • JavaScript is definitely not a system programming language! Use Java or C++ for this type of activity.

Click to Read More

Core JavaScript Reference

This book is a reference manual for the core JavaScript language for version 1.5. JavaScript is Netscape's cross-platform, object-based scripting language. Core JavaScript can be extended for a variety of purposes by supplementing it with additional objects.

JavaScript version 1.5 provides the following features and enhancements:

  • Runtime errors. Runtime errors are now reported as exceptions.
  • Number formatting enhancements. Number formatting has been enhanced to include Number.prototype.toExponential, Number.protoytpe.toFixed and Number.prototype.toPrecision methods. See page 127, page 128, and page 129.
  • Regular expression enhancements:
    (1) Greedy quantifiers - +, *, ? and {} - can now be followed by a ? to force them to be non-greedy. See the entry for ? on page 148.
    (2) Non-capturing parentheses, (?:x) can be used instead of capturing parentheses(x). When non-capturing parentheses are used, matched subexpressions are not available as back-references. See the entry for (?:x) on page 148.
    (3) Positive and negative lookahead assertions are supported. Both assert a match depending on what follows the string being matched. See the entries for (?=) and (?!) on page 148.
    (4) The m flag has been added to specify that the regular expression should match over multiple lines. See page 146.
  • Conditional function declarations. Functions can now be declared inside an if clause. See page 221.
  • Function expressions. Functions can now be declared inside an expression. See page 254.
  • Multiple catch clauses. Multiple catch clauses in a try...catch statement are supported. See page 231.
  • Constants. Readonly, named constants are supported. This feature is available only in the C implementation of JavaScript. See page 215.
  • Getters and Setters. JavaScript writers can now add getters and setters to their objects. This feature is available only in the C implementation of JavaScript. See Defining Getters and Setters in Chapter 7 of the Core JavaScript Guide for information about this feature.

Click to Read More

Teach Yourself JavaScript in a Week

By Arman Danesh
In this book we are going to take a look at JavaScript—the internal scripting language Netscape has developed and included in the Navigator browser.
JavaScript is an evolving tool, like so many tools associated with the Internet and the World Wide Web. Still, the future of JavaScript is sufficiently clear that many people have already developed sophisticated Web-based applications using the language.
We start by taking a broad look at Netscape Navigator 2.0, the current version of the popular Web browser, which some estimates say commands more than 80 percent of the Web browser market. Following this, we take an introductory look at JavaScript and its relationship with Java and its place in the Netscape suite of Web development tools.
Once this is done, we will be ready to look at the nuts and bolts of the JavaScript language and learn how to apply them to real-world scenarios on the Web. JavaScript can be used to add a wide range of interactivity and functionality to Web pages including the following:
  • Dynamic forms that include built-in error checking
  • Spread sheets and calculators
  • User interaction in the form of warning messages and confirmation messages
  • Dynamic changes to text and background colors
  • The ability to analyze URLs and access URLs in a user's history list
  • The capability to open, name, clear, and close new windows and direct output to specific frames

These types of functions already appear in numerous Web sites on the World Wide Web, and it is expected that the number will grow rapidly in early 1996 now that Navigator 2.0 has moved from being a beta product to commercial release software.

Throughout the book, you will have the opportunity to develop several small scripts that you can immediately use in your own Web pages.

Finally, we close with a review of the future of JavaScript and where it seems to be heading. We will consider Netscape's plans as well as announcements from other companies to include JavaScript in their products.

Click to Read More

JavaScript The Definitive Guide - Fourth Edition

by David Flanagan

This edition of JavaScript: The Definitive Guide has been thoroughly updated in light of the changes I just described. Major new features include complete coverage of JavaScript 1.5 and the third edition of the ECMA-262 standard on which it is based, and complete coverage of the Level 2 DOM standard.
Throughout the book, the focus has shifted from documenting particular JavaScript and browser implementations ( JavaScript 1.2, Netscape 4, Internet Explorer 5, etc.) to documenting the standards upon which those implementations are (or ought to be) based. Because of the proliferation of implementations, it is no longer practical for any one book to attempt to document -- or for any one developer to attempt to understand -- every feature, proprietary extension, quirk, and bug of every implementation. Focusing on the specifications instead of the implementations makes this book easier to use and, if you take the same approach, will make your JavaScript code more portable and maintainable. You'll particularly notice the increased emphasis on standards in the new material on core JavaScript and the DOM.
Another major change in this edition is that the reference section has been split into three distinct parts. First, the core JavaScript material has been separated from the client-side JavaScript material (Part IV) and placed in a section of its own (Part III). This division is for the convenience of JavaScript programmers who are working with the language in an environment other than a web browser and who are not interested in client-side JavaScript.
Second, the new material documenting the W3C DOM has been placed in a section of its own (Part V), separate from the existing client-side JavaScript material. The DOM standard defines an API that is quite distinct from the "legacy" API of traditional client-side JavaScript. Depending on the browser platforms they are targeting, developers typically use one API or the other and usually do not need to switch back and forth. Keeping these two APIs distinct also preserves the organization of the existing client-side reference material, which is convenient for readers of the third edition who upgrade to this edition.
In order to accommodate all the new material without making the book much, much larger, I've gotten rid of reference pages for the trivial properties of objects. These properties are already described once on the reference page for the object, and putting another description in a reference page of its own was redundant and wasteful. Properties that require substantial description, as well as all methods, still have reference pages of their own. Furthermore, the design wizards at O'Reilly have created a new interior design for the book that remains easy and pleasant to read but takes up less space.
Click to Read More

ppk on JavaScript

By Peter-Paul Koch
The purpose of this book is to offer easy access to all the basic JavaScript knowledge I've gathered in the eight years I've been a professional Web developer.
Since this book reflects my knowledge, it also reflects the limitations of that knowledge. I am a Web developer, not an application developer—which means I talk about browser incompatibilities, accessibility, low-level syntax, and cooperation with the HTML structural layer, instead of modules, design principles, and abstraction layers.
During the eight years that I've earned a living by making Web sites, I have used some JavaScript features extensively but largely ignored others. I always took the tools I needed to do the job I was paid to do, and it turns out that the JavaScript toolbox contains many features I don't need in my day-to-day use.
Obviously, I cannot teach you to use a tool that I myself don't understand. Therefore this book only treats those language features I work with. Object-oriented JavaScript, for instance, is conspicuously absent because I've never seen the need to use it.
Besides, a book has a fixed length, and therefore I had to make choices—occasionally very difficult ones. In the end I selected those JavaScript features that I feel you must understand in order to use the language at competent intermediate to advanced level. I left out other features that aren't quite so essential—in my opinion. Some of my readers will disagree with my selections, but that can't be helped.

Followers