october 7 th, 2010 sdu webship. what did we learn last week? jquery makes it really easy to select...

14
October 7 th , 2010 SDU Webship

Upload: blaze-woods

Post on 18-Jan-2018

214 views

Category:

Documents


0 download

DESCRIPTION

How to remember things HTTP (HyperText Transfer Protocol) is a stateless protocol. This means that it has no memory of any past queries. What can we do if we want our webpage to remember users? Cookies!

TRANSCRIPT

Page 1: October 7 th, 2010 SDU Webship. What did we learn last week? jQuery makes it really easy to select elements and do stuff with them. jQuery can process

October 7th, 2010

SDU Webship

Page 2: October 7 th, 2010 SDU Webship. What did we learn last week? jQuery makes it really easy to select elements and do stuff with them. jQuery can process

What did we learn last week?jQuery makes it really easy to select

elements and do stuff with them.jQuery can process data, create visual

effects, and add other interactive elements to your websites

All of this could be done with plain Javascript, but it would take about 20x longer.

https://developer.mozilla.org/en/JavaScript/Guide

Page 3: October 7 th, 2010 SDU Webship. What did we learn last week? jQuery makes it really easy to select elements and do stuff with them. jQuery can process

How to remember thingsHTTP (HyperText Transfer Protocol) is a

stateless protocol.This means that it has no memory of any

past queries.What can we do if we want our webpage to

remember users?Cookies!

Page 4: October 7 th, 2010 SDU Webship. What did we learn last week? jQuery makes it really easy to select elements and do stuff with them. jQuery can process

What is a cookie?A cookie is a string of text with a name

which is sent and called by a webpage.Cookies are “set” (stored in the memory of

your browser) using the HTTP protocol.Cookies are retrieved by a browser requestMay have expiration date; if not, will be

stored until cookies are cleared. Cookies cannot be executed, but can be

used as spyware.

Page 5: October 7 th, 2010 SDU Webship. What did we learn last week? jQuery makes it really easy to select elements and do stuff with them. jQuery can process

Graphically:

Page 6: October 7 th, 2010 SDU Webship. What did we learn last week? jQuery makes it really easy to select elements and do stuff with them. jQuery can process

What are cookies used for?Session managementPersonalizationTracking

Page 7: October 7 th, 2010 SDU Webship. What did we learn last week? jQuery makes it really easy to select elements and do stuff with them. jQuery can process

Setting and retrieving cookies$.cookie("example", "foo");$.cookie("example", "foo", { expires: 7 });alert($.cookie("example") );$.cookie("example", null);

Page 8: October 7 th, 2010 SDU Webship. What did we learn last week? jQuery makes it really easy to select elements and do stuff with them. jQuery can process

AjaxAsynchronous Javascript and XMLUsed to send and retrieve data without

reloading the page.XMLHttpRequest object (to exchange data

asynchronously with a server)JavaScript/DOM (to display/interact with the

information)CSS (to style the data)XML (often used as the format for

transferring data)

Page 9: October 7 th, 2010 SDU Webship. What did we learn last week? jQuery makes it really easy to select elements and do stuff with them. jQuery can process

Why use it?Improves interaction – pages don’t need to

reload every time data changes.Added functionality – chat, suggestions,

etc.

Page 10: October 7 th, 2010 SDU Webship. What did we learn last week? jQuery makes it really easy to select elements and do stuff with them. jQuery can process

Demo time!http://www.ajaxdaddy.com/

Page 11: October 7 th, 2010 SDU Webship. What did we learn last week? jQuery makes it really easy to select elements and do stuff with them. jQuery can process

Whatsitlooklike?http://jquery.com/demo/ajax/

Page 12: October 7 th, 2010 SDU Webship. What did we learn last week? jQuery makes it really easy to select elements and do stuff with them. jQuery can process

Ajax and interactionNon-jQuery implementation:

http://www.albertwavering.com/ajaxsample.html

jQueryhttp://jquery.com/demo/ajax/

Page 13: October 7 th, 2010 SDU Webship. What did we learn last week? jQuery makes it really easy to select elements and do stuff with them. jQuery can process

Next week:Applied AJAX (send/receive)HTML, CSS, and Javascript reviewAfter we review the basics, we will move

onto more advanced topics.

Page 14: October 7 th, 2010 SDU Webship. What did we learn last week? jQuery makes it really easy to select elements and do stuff with them. jQuery can process

HomeworkReview slides from previous weeksEmail us or come to office hours if you have

questions – we want to be sure that you understand everything before we move on!