22.04.2013 Views

HTML, XHTML & CSS

HTML, XHTML & CSS

HTML, XHTML & CSS

SHOW MORE
SHOW LESS

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

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

20<br />

Part IV: Scripting and (X)<strong>HTML</strong><br />

An innovative use of JavaScript occurs in Gmail, the free Web-based e-mail<br />

service from Google, which you can find at www.gmail.com. Gmail uses<br />

JavaScript to load an entire e-mail user interface into the user’s browser,<br />

which makes Gmail much more responsive to user actions than most other<br />

Web-based mail programs. Gmail uses JavaScript to keep to an absolute minimum<br />

the number of times the page has to fetch additional information from<br />

the servers. By doing much of the processing in the user’s browser, the Gmail<br />

Web application feels more like an e-mail program that runs on your computer.<br />

Figure 13-5 shows the JavaScript-powered Gmail interface. It’s a great<br />

example of the power of JavaScript.<br />

Figure 13-5: The Gmail interface is powered by JavaScript.<br />

JavaScript is a scripting language that runs<br />

inside the browser, but there are other scripting<br />

languages that run on the server side, such<br />

as Perl, ASP (Active Server Pages), PHP (PHP<br />

Hypertext Preprocessor, an (X)<strong>HTML</strong> embedded<br />

scripting language), Python, .NET, and others.<br />

Programs written in these languages reside<br />

on the server and are called by the Web page,<br />

usually in response to a form filled out by the<br />

user. People who write these Web pages may<br />

include snippets of code that pass bits of information<br />

from the <strong>HTML</strong> page to the program on<br />

Server-side scripting<br />

the server. When called, the program runs and<br />

then returns a result of some sort to the user.<br />

Amazon (www.amazon.com) runs a familiar<br />

e-commerce Web application that runs mostly<br />

on the server side, using server scripts. Web<br />

pages displayed by the browser when you visit<br />

Amazon result from processing server-side<br />

scripts, all of which take place before the page<br />

ever hits your browser. If you’d like more information<br />

on JavaScript and what it can do for<br />

you, check out JavaScript For Dummies, Quick<br />

Reference by Emily A. Vander Veer.

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

Saved successfully!

Ooh no, something went wrong!