Skip to Main Content
Head Rush Ajax
book

Head Rush Ajax

by Brett McLaughlin
March 2006
Beginner to intermediate content levelBeginner to intermediate
448 pages
13h 33m
English
O'Reilly Media, Inc.
Content preview from Head Rush Ajax
132
Remember the rst part of the request URL from
getCustomerInfo()?
The request URL is a relative URL
Wait a second. If there’s a mistake in
the request URL, is the server even
getting our request?
This is a relative URL, and doesn’t include the domain name
of the server that the request should be sent to. So what
domain does the browser send this request to? The browser
will automatically use the same domain that it requested the
pizza.html web page from. So if you entered http://www.
breakneckpizza.com/pizza.html to view the Break Neck order
form, your web browser would turn the relative URL above
into an absolute URL, like this:
lookupCustomer.php
http://www.breakneckpizza.com/lookupCustomer.php
We’ve left off
the “phone” request
parameter to make
this a little shorter.
So the request gets sent to the same server that your browser
downloaded the pizza order form from. Even if the program
to run on the server is ... mis-spelled ... the request will still get
sent by your browser to the right server.
absolute and relative urls
This program could be
a Java servlet, or a
PHP script, or a Ruby
component, or any other
bit of code running on
the the server.
http://www.boardsrus.com/getUpdatesBoardSales.php
/getUpdatesBoardSales.php
This is an absolute URL. It has
a domain name...
...and a path to a program or
le on the server.
This is an relative URL. It has
no domain name...
...and just the pa ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Reinventing the Organization for GenAI and LLMs

Reinventing the Organization for GenAI and LLMs

Ethan Mollick
Head First Ajax

Head First Ajax

Rebecca M. Riordan

Publisher Resources

ISBN: 0596102259Errata PageSupplemental Content