Java Reference
In-Depth Information
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 shopkeeper 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 we're talking about.
www.somewebsite.com
n
ame 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.
What Can Javascript do for me?
JavaScript is primarily used to interact with users. That's a rather broad statement, so let's break
“interact with users” into two categories: user input validation and enhancement.
JavaScript was originally created for validating form input. For example, if you had a form that
takes a user's credit card details in preparation for on online purchase of goods, you'd want to make
sure he had actually filled in those details before you sent the goods. You might also want to check
that the data being entered is of the correct type, such as a number for his age rather than text.
Thanks to the advances made in today's JavaScript engines, JavaScript is used for much, much
more than input‐related tasks. In fact, advanced JavaScript‐driven applications can be created
that rival the speed and functionality of conventional desktop applications. Examples of such
applications include Google Maps, Google Calendar, and even full‐fledged productivity software
such as Microsoft's Office Web Apps. These applications provide a real service. In most of these
applications, JavaScript only powers the user interface, with the actual data processing being done
on the server. But even then, JavaScript could be used on the server if used with a JavaScript‐based
processing engine (one such environment is called Node).
tools needed to Create Javascript Web applications
The great news is that learning JavaScript requires no expensive software purchases; you can learn
JavaScript for free on any PC or Mac. This section discusses what tools are available and how to
obtain them.
Development tools
All that you need to get started writing JavaScript code for web applications is a simple text editor,
such as Notepad for Windows or TextEdit for Mac OS X. You can also use one of the many