Java Reference
In-Depth Information
Firefox, Internet Explorer, or Safari. Later chapters look at features available only to current browsers like
Firefox 3 or later and Internet Explorer 7 and 8. You'll look into the problems with different browsers
and versions of JavaScript later in this chapter and see how to deal with them.
You'll sometimes hear JavaScript referred to as ECMAScript. The ECMA (European Computer
Manufacturers Association) is a private organization that develops standards in information and com-
munication systems. One of the standards they control is for JavaScript, which they call ECMAScript.
Their standard controls various aspects of the language and helps ensure that different versions of
JavaScript are compatible. However, while the ECMA sets standards for the actual language, they
don't specify how it's used in particular hosts. By host , we mean hosting environment; in this topic,
that will be the web browser. Other hosting environments include PDF fi les, web servers, Macromedia
Flash applications, and many, many other places. In this topic, we discuss only its use within the web
browser. The organization that sets the standards for web pages is the World Wide Web Consortium
(W3C). They not only set standards for HTML, XHML, and XML, but also for how JavaScript interacts
with web pages inside a web browser. You'll learn much more about this in later chapters of the topic.
Initially, you'll look at the essentials of JavaScript before the more advanced stuff. In the appendices
of this topic, you'll fi nd useful guides to the JavaScript language and how it interacts with the web
browser.
The majority of the web pages containing JavaScript that you create in this topic can be stored on your
hard drive and loaded directly into your browser from the hard drive itself, just as you'd load any nor-
mal fi le (such as a text fi le). However, this is not how web pages are loaded when you browse web sites
on the Internet. The Internet is really just one great big network connecting computers. Access to web
sites is a special service provided by particular computers on the Internet; the computers providing this
service are known as web servers .
Basically, the job of a web server is to hold lots of web pages on its hard drive. When a browser, usually
on a different computer, requests a web page contained on that web server, the web server loads it from
its own hard drive and then passes the page back to the requesting computer via a special communica-
tions protocol called Hypertext Transfer Protocol (HTTP) . The computer running the web browser that
makes the request is known as the client. Think of the client/server relationship as a bit like a customer/
shopkeeper relationship. The customer goes into a shop and says, “Give me one of those.” The shop-
keeper serves the customer by reaching for the item requested and passing it back to the customer. In
a web situation, the client machine running the web browser is like the customer, and the web server
providing the page requested is like the shopkeeper.
When you type an address into the web browser, how does it know which web server to get the page
from? Well, just as shops have addresses, say, 45 Central Avenue, Sometownsville, so do web servers.
Web servers don't have street names; instead, they have Internet protocol (IP) addresses , which uniquely
identify them on the Internet. These consist of four sets of numbers, separated by dots (for example,
127.0.0.1).
If you've ever surfed the net, you're probably wondering what on earth I'm talking about. Surely web
servers have nice www.somewebsite.com names, not IP addresses? In fact, the www.somewebsite.com
name is the “friendly” name for the actual IP address; it's a whole lot easier for us humans to remember.
On the Internet, the friendly name is converted to the actual IP address by computers called domain
name servers , which your Internet service provider will have set up for you.
One last thing: Throughout this topic, we'll be referring to the Internet Explorer browser as IE.
Search WWH ::




Custom Search