10.02.2014 Views

Beginning Ajax With ASP.NET (2006).pdf

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

JavaScript and the Document Object Model<br />

Browser innovation continued at a rapid rate, and incompatibilities continued among different vendors’<br />

browsers. Many libraries were developed that attempted to provide a common application program interface<br />

(API) between the different browsers. These would typically enable a common way of developing<br />

Dynamic HTML (DHTML) applications across many browsers, but they were only moderately successful.<br />

During this time, Microsoft, Netscape, and a number of other companies worked with the World Wide<br />

Web Consortium (W3C) to provide a consistent and standardized DOM. This was an attempt to remove<br />

the current complexity with developing DHTML applications across a variety of browsers.<br />

The W3C develops interoperable technologies (specifications, guidelines, software, and tools) for all<br />

web-related technologies. You can visit their web site for more information at www.w3.org.<br />

Throughout this chapter, you will look at the core components of JavaScript and methods of interacting<br />

with and manipulating the DOM. While still not fully realized, cross-browser compatibility with respect<br />

to the DOM is much improved and is much easier than it previously was. However, inconsistencies<br />

among vendor implementations still remain, and there are still many libraries and frameworks available<br />

to provide a common API across vendors’ browser implementations. Some of these libraries are discussed<br />

in Chapter 9 of this book.<br />

Today, JavaScript is the prevalent scripting language of browsers. It is the primary method of achieving<br />

dynamic client-side interactivity in web applications. Microsoft has already initiated work at integrating<br />

the powerful server-side programming environment of <strong>ASP</strong>.<strong>NET</strong> with JavaScript support. Technologies<br />

such as asynchronous client scripting and Atlas will also be discussed in later chapters of this book.<br />

All of these advanced technologies make use of the core components and features of JavaScript.<br />

Digging into Some More JavaScript Basics<br />

Chapter 2 started your introduction to JavaScript, particularly in showing how it can interact with the<br />

browser environment to modify the HTML and CSS that make up a web page. In this chapter, you will<br />

build on and extend what you learned in Chapter 2.<br />

Take a look at the following simple JavaScript:<br />

<br />

<br />

<br />

Basic Javascript<br />

<br />

alert(“Hi, I am some simple JavaScript”);<br />

<br />

<br />

<br />

Simple Javascript Page<br />

<br />

<br />

31

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!