[ Pobierz całość w formacie PDF ]
Chapter 1. using ajax
Table of Contents
................................................................................... 1
..................................................................................................................... 2
................................................................................................................................................. 3
.................................................................................................................................... 5
................................................................................................................................. 6
.................................................................................................................................. 12
........................................................................................................................................ 14
................................................................................................................................. 16
................................................................................................................................. 20
..................................................................................................................................... 22
............................................................................................... 24
...................................................................... 25
......................................................................................................................... 26
............................................................................. 27
.............................................................................................................................. 28
.................................................................................................... 30
.............................................................................................................................................. 31
................................................................................. 35
.......................................................... 36
.............................................................................................................................. 38
............................................................................................................................................................. 39
Chapter 1. using ajax
Head First Ajax By Rebecca M. Riordan ISBN: 9780596515782 Publisher: O'Reilly Prepared for Ann Cherkis, Safari ID: maottw@gmail.com
Print Publication Date: 2008/08/26 User number: 1673621 Copyright 2008, Safari Books Online, LLC.
This PDF is exclusively for your use in accordance with the Safari Terms of Service. No part of it may be reproduced or transmitted in any form by any means without the prior
written permission for reprints and excerpts from the publisher. Redistribution or other use that violates the fair use priviledge under U.S. copyright laws (see 17 USC107) or that
otherwise violates the Safari Terms of Service is strictly prohibited.
Chapter 1. using ajax
Page 1
1
using ajax
Web Apps for a New
Generation
,·OOMXVWWDNHDOLWWOHQDS
ZKLOH,·PZDLWLQJIRUP\
ZHEDSSWRUHVSRQG
Tired of waiting around for your page to reload?
)UXVWUDWHGE\FOXQN\ZHEDSSOLFDWLRQLQWHUIDFHV",W¶VWLPHWRJLYH\RXUZHEDSSVWKDW
VOLFNUHVSRQVLYHGHVNWRSIHHO$QGKRZGR\RXGRWKDW":LWK
Ajax
\RXUWLFNHWWR
EXLOGLQJ,QWHUQHWDSSOLFDWLRQVWKDWDUH
more interactive, more responsive,
DQG
easier
6RVNLS\RXUQDSLW¶VWLPHWRSXWVRPHSROLVKRQ\RXUZHEDSSV,W¶VWLPHWR
JHWULGRIXQQHFHVVDU\DQGVORZIXOOSDJHUHIUHVKHVIRUHYHU
this is a new chapter
1
Chapter 1. using ajax
Head First Ajax By Rebecca M. Riordan ISBN: 9780596515782 Publisher: O'Reilly Prepared for Ann Cherkis, Safari ID: maottw@gmail.com
Print Publication Date: 2008/08/26 User number: 1673621 Copyright 2008, Safari Books Online, LLC.
This PDF is exclusively for your use in accordance with the Safari Terms of Service. No part of it may be reproduced or transmitted in any form by any means without the prior
written permission for reprints and excerpts from the publisher. Redistribution or other use that violates the fair use priviledge under U.S. copyright laws (see 17 USC107) or that
otherwise violates the Safari Terms of Service is strictly prohibited.
to use
Chapter 1. using ajax
Page 2
old-fashioned
web apps
Web pages: the old-fashioned approach
With traditional web pages and applications, every time a user clicks on
something, the browser sends a request to the server, and the server responds
with a
whole new page
. Even if your user’s web browser is smart about
caching things like images and cascading style sheets, that’s a lot of traffic
going back and forth between their browser and your server... and a lot of
time that the user sits around waiting for full page refreshes.
chan
ging... b
ut there
’s still a
complete
page re
fresh.
A
nd th
e serve
r
sends
back
anothe
r
who
le page
...
2
Chapter 1
Chapter 1. using ajax
Head First Ajax By Rebecca M. Riordan ISBN: 9780596515782 Publisher: O'Reilly Prepared for Ann Cherkis, Safari ID: maottw@gmail.com
Print Publication Date: 2008/08/26 User number: 1673621 Copyright 2008, Safari Books Online, LLC.
This PDF is exclusively for your use in accordance with the Safari Terms of Service. No part of it may be reproduced or transmitted in any form by any means without the prior
written permission for reprints and excerpts from the publisher. Redistribution or other use that violates the fair use priviledge under U.S. copyright laws (see 17 USC107) or that
otherwise violates the Safari Terms of Service is strictly prohibited.
Most
of the t
ime, only
a single
line or i
mage is
Chapter 1. using ajax
Page 3
using
ajax
Web pages reinvented
Using Ajax, your pages and applications only ask the server for what they
really need—just the parts of a page that need to change, and just the parts
that the server has to provide. That means less traffic, smaller updates, and
less time sitting around
waiting for page refreshes.
With Ajax, the browser only sends and receives
the parts of a page that need to change.
a spe
cial req
uest o
bject t
hat t
he
bro
wser se
nds to
the s
erver.
request
function
getDetails {
...
}
request
...an
d your cod
e tells the
b
rowser to
update only
the
parts of
the page t
hat
have c
hanged.
Sometimes the browser doesn’t have to
talk to the server at all.
Th
e script
can up
date th
e
image w
ithout t
he serve
r-side
progra
m at al
l!
function
getDetails {
...
}
Th
e scrip
t tells
the bro
wser
how to
update
the pa
ge... all
witho
ut a pa
ge refr
esh.
you are here
3
Chapter 1. using ajax
Head First Ajax By Rebecca M. Riordan ISBN: 9780596515782 Publisher: O'Reilly Prepared for Ann Cherkis, Safari ID: maottw@gmail.com
Print Publication Date: 2008/08/26 User number: 1673621 Copyright 2008, Safari Books Online, LLC.
This PDF is exclusively for your use in accordance with the Safari Terms of Service. No part of it may be reproduced or transmitted in any form by any means without the prior
written permission for reprints and excerpts from the publisher. Redistribution or other use that violates the fair use priviledge under U.S. copyright laws (see 17 USC107) or that
otherwise violates the Safari Terms of Service is strictly prohibited.
T
his ti
me, you
r page
’s code
creat
es
[ Pobierz całość w formacie PDF ]
zanotowane.pl doc.pisz.pl pdf.pisz.pl audipoznan.keep.pl
Chapter 1. using ajax
Table of Contents
................................................................................... 1
..................................................................................................................... 2
................................................................................................................................................. 3
.................................................................................................................................... 5
................................................................................................................................. 6
.................................................................................................................................. 12
........................................................................................................................................ 14
................................................................................................................................. 16
................................................................................................................................. 20
..................................................................................................................................... 22
............................................................................................... 24
...................................................................... 25
......................................................................................................................... 26
............................................................................. 27
.............................................................................................................................. 28
.................................................................................................... 30
.............................................................................................................................................. 31
................................................................................. 35
.......................................................... 36
.............................................................................................................................. 38
............................................................................................................................................................. 39
Chapter 1. using ajax
Head First Ajax By Rebecca M. Riordan ISBN: 9780596515782 Publisher: O'Reilly Prepared for Ann Cherkis, Safari ID: maottw@gmail.com
Print Publication Date: 2008/08/26 User number: 1673621 Copyright 2008, Safari Books Online, LLC.
This PDF is exclusively for your use in accordance with the Safari Terms of Service. No part of it may be reproduced or transmitted in any form by any means without the prior
written permission for reprints and excerpts from the publisher. Redistribution or other use that violates the fair use priviledge under U.S. copyright laws (see 17 USC107) or that
otherwise violates the Safari Terms of Service is strictly prohibited.
Chapter 1. using ajax
Page 1
1
using ajax
Web Apps for a New
Generation
,·OOMXVWWDNHDOLWWOHQDS
ZKLOH,·PZDLWLQJIRUP\
ZHEDSSWRUHVSRQG
Tired of waiting around for your page to reload?
)UXVWUDWHGE\FOXQN\ZHEDSSOLFDWLRQLQWHUIDFHV",W¶VWLPHWRJLYH\RXUZHEDSSVWKDW
VOLFNUHVSRQVLYHGHVNWRSIHHO$QGKRZGR\RXGRWKDW":LWK
Ajax
\RXUWLFNHWWR
EXLOGLQJ,QWHUQHWDSSOLFDWLRQVWKDWDUH
more interactive, more responsive,
DQG
easier
6RVNLS\RXUQDSLW¶VWLPHWRSXWVRPHSROLVKRQ\RXUZHEDSSV,W¶VWLPHWR
JHWULGRIXQQHFHVVDU\DQGVORZIXOOSDJHUHIUHVKHVIRUHYHU
this is a new chapter
1
Chapter 1. using ajax
Head First Ajax By Rebecca M. Riordan ISBN: 9780596515782 Publisher: O'Reilly Prepared for Ann Cherkis, Safari ID: maottw@gmail.com
Print Publication Date: 2008/08/26 User number: 1673621 Copyright 2008, Safari Books Online, LLC.
This PDF is exclusively for your use in accordance with the Safari Terms of Service. No part of it may be reproduced or transmitted in any form by any means without the prior
written permission for reprints and excerpts from the publisher. Redistribution or other use that violates the fair use priviledge under U.S. copyright laws (see 17 USC107) or that
otherwise violates the Safari Terms of Service is strictly prohibited.
to use
Chapter 1. using ajax
Page 2
old-fashioned
web apps
Web pages: the old-fashioned approach
With traditional web pages and applications, every time a user clicks on
something, the browser sends a request to the server, and the server responds
with a
whole new page
. Even if your user’s web browser is smart about
caching things like images and cascading style sheets, that’s a lot of traffic
going back and forth between their browser and your server... and a lot of
time that the user sits around waiting for full page refreshes.
chan
ging... b
ut there
’s still a
complete
page re
fresh.
A
nd th
e serve
r
sends
back
anothe
r
who
le page
...
2
Chapter 1
Chapter 1. using ajax
Head First Ajax By Rebecca M. Riordan ISBN: 9780596515782 Publisher: O'Reilly Prepared for Ann Cherkis, Safari ID: maottw@gmail.com
Print Publication Date: 2008/08/26 User number: 1673621 Copyright 2008, Safari Books Online, LLC.
This PDF is exclusively for your use in accordance with the Safari Terms of Service. No part of it may be reproduced or transmitted in any form by any means without the prior
written permission for reprints and excerpts from the publisher. Redistribution or other use that violates the fair use priviledge under U.S. copyright laws (see 17 USC107) or that
otherwise violates the Safari Terms of Service is strictly prohibited.
Most
of the t
ime, only
a single
line or i
mage is
Chapter 1. using ajax
Page 3
using
ajax
Web pages reinvented
Using Ajax, your pages and applications only ask the server for what they
really need—just the parts of a page that need to change, and just the parts
that the server has to provide. That means less traffic, smaller updates, and
less time sitting around
waiting for page refreshes.
With Ajax, the browser only sends and receives
the parts of a page that need to change.
a spe
cial req
uest o
bject t
hat t
he
bro
wser se
nds to
the s
erver.
request
function
getDetails {
...
}
request
...an
d your cod
e tells the
b
rowser to
update only
the
parts of
the page t
hat
have c
hanged.
Sometimes the browser doesn’t have to
talk to the server at all.
Th
e script
can up
date th
e
image w
ithout t
he serve
r-side
progra
m at al
l!
function
getDetails {
...
}
Th
e scrip
t tells
the bro
wser
how to
update
the pa
ge... all
witho
ut a pa
ge refr
esh.
you are here
3
Chapter 1. using ajax
Head First Ajax By Rebecca M. Riordan ISBN: 9780596515782 Publisher: O'Reilly Prepared for Ann Cherkis, Safari ID: maottw@gmail.com
Print Publication Date: 2008/08/26 User number: 1673621 Copyright 2008, Safari Books Online, LLC.
This PDF is exclusively for your use in accordance with the Safari Terms of Service. No part of it may be reproduced or transmitted in any form by any means without the prior
written permission for reprints and excerpts from the publisher. Redistribution or other use that violates the fair use priviledge under U.S. copyright laws (see 17 USC107) or that
otherwise violates the Safari Terms of Service is strictly prohibited.
T
his ti
me, you
r page
’s code
creat
es
[ Pobierz całość w formacie PDF ]