solving common client requets with jquery presentation (v2)

57
1

Upload: chris-coyier

Post on 01-Sep-2014

8.606 views

Category:

Technology


2 download

DESCRIPTION

Given at the jQuery Summit November 2010.

TRANSCRIPT

Page 1: Solving Common Client Requets with jQuery Presentation (v2)

1

Page 2: Solving Common Client Requets with jQuery Presentation (v2)

The

ROYAL “WE”

wufoo.com

OnlineForm Builder

css-tricks.com

Web DesignCommunity

digwp.com

Book and Blogabout WordPress

2

Page 3: Solving Common Client Requets with jQuery Presentation (v2)

The

BACKSTORY• Small design company

• Many clients• Sole web designer/developer

3

Page 4: Solving Common Client Requets with jQuery Presentation (v2)

My strategies for

INSTANT PRODUCTIVITYAll websites...

... were on the same server... registered at same domain registrant... used same organizational structure... used common naming conventions

... used standard code formatting... all forms built with Wufoo

... used WordPress as the CMS

4

Page 5: Solving Common Client Requets with jQuery Presentation (v2)

My strategies for

INSTANT PRODUCTIVITY

All websites used jQuery for the JavaScript library

Use the tools that you know

5

Page 6: Solving Common Client Requets with jQuery Presentation (v2)

The

SUPER BASICSThe Working Environment

1) Load jQuery

2) Load dependent scripts (e.g. plugins)

3) Your code

6

Page 7: Solving Common Client Requets with jQuery Presentation (v2)

The

SUPER BASICSThe Working Environment

1) Load jQuery

2) Load dependent scripts (e.g. plugins)

3) Your code

<script>s in your HTML

7

Page 8: Solving Common Client Requets with jQuery Presentation (v2)

8

Page 9: Solving Common Client Requets with jQuery Presentation (v2)

9

Page 10: Solving Common Client Requets with jQuery Presentation (v2)

The

SUPER BASICSFind something... Do something...

10

Page 11: Solving Common Client Requets with jQuery Presentation (v2)

#1

CHANGING CONTENT

Hey Chris,Can you change “xxx” to “yyy”?

... that it turns out you don’t haveany control over ...

11

Page 12: Solving Common Client Requets with jQuery Presentation (v2)

So...

Why no control?

• Content is third-party template you can’t change

• Too entrenched / Too much red tape

• Content is inserted from elsewhere

12

Page 13: Solving Common Client Requets with jQuery Presentation (v2)

foxycart.com

13

Page 14: Solving Common Client Requets with jQuery Presentation (v2)

14

Page 15: Solving Common Client Requets with jQuery Presentation (v2)

getfirebug.com

15

Page 16: Solving Common Client Requets with jQuery Presentation (v2)

Change Text

Display

Change Text

Display

16

Page 17: Solving Common Client Requets with jQuery Presentation (v2)

17

Page 21: Solving Common Client Requets with jQuery Presentation (v2)

Smashing Network Widget (Cont.)

The jQuery Swaperoo

21

Page 22: Solving Common Client Requets with jQuery Presentation (v2)

jsbin.com/egosu3/edit

Smashing Network Widget (Cont.)

Result

22

Page 23: Solving Common Client Requets with jQuery Presentation (v2)

23

Page 24: Solving Common Client Requets with jQuery Presentation (v2)

• Don’t have markup controlbut can use jQuery

• Fairly rare... Third party services, Huge applications - Separation between

designers and developers

• Find out a year later...FoxyCart totally does allow you to

change language

Quick recap of...

CHANGING CONTENT

24

Page 25: Solving Common Client Requets with jQuery Presentation (v2)

#2

LOADING CONTENT

Hey Chris,Can we add this huge block oftext to the checkout page?

Now with more easy!

25

Page 26: Solving Common Client Requets with jQuery Presentation (v2)

Hyper SimplifiedCheckout Form

26

Page 27: Solving Common Client Requets with jQuery Presentation (v2)

Friday at 4:52pm27

Page 28: Solving Common Client Requets with jQuery Presentation (v2)

Monday at 9:08am28

Page 29: Solving Common Client Requets with jQuery Presentation (v2)

Monday at 1:20pm29

Page 30: Solving Common Client Requets with jQuery Presentation (v2)

30

Page 31: Solving Common Client Requets with jQuery Presentation (v2)

31

Page 32: Solving Common Client Requets with jQuery Presentation (v2)

Check ifelement exists

32

Page 33: Solving Common Client Requets with jQuery Presentation (v2)

Element Creation

Get Content(AJAX... Boom)

33

Page 34: Solving Common Client Requets with jQuery Presentation (v2)

• What are they really asking for?vs. What do the users need?

• Enough content to warrant a special page?

• jQuery: Pop-up box, .load() content

• Best of both worlds

Quick recap of...

CHANGING CONTENT

34

Page 35: Solving Common Client Requets with jQuery Presentation (v2)

More on...

LIGHTBOXES

colorpowered.com/colorbox/

• Different kinds of content:Photos / Video / Inline Content / Ajax Content / Slideshow

• Events:Resizing / Transitions / Callbacks

• Mo Betta Cross Browser

• Themes

35

Page 36: Solving Common Client Requets with jQuery Presentation (v2)

36

Page 37: Solving Common Client Requets with jQuery Presentation (v2)

#3

LET’S GO WEB 2.0

Hey Chris,We’d like to show our latest tweeton our homepage!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Social media!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

37

Page 38: Solving Common Client Requets with jQuery Presentation (v2)

All the hip services hand out JSONTwitter docs: http://dev.twitter.com/doc/get/statuses/user_timelineExample URL: http://twitter.com/statuses/user_timeline/chriscoyier.json

38

Page 42: Solving Common Client Requets with jQuery Presentation (v2)

• Top priority: it doesn’t affect the normal page load time.(You don’t want to rely on the Twitter API for your site to load)

• Only append upon success

• Only show non-replies

• “Tweetify” http://css-tricks.com/snippets/jquery/jquery-tweetify-text/

• @Anywhere http://dev.twitter.com/anywhere

Quick recap of...

TWITTERIZATION

42

Page 44: Solving Common Client Requets with jQuery Presentation (v2)

#4

DON’T STOP THE MUSIC

Hey Chris,We want the music player on our site to continuously play while people are on our website.

44

Page 45: Solving Common Client Requets with jQuery Presentation (v2)

• Music will stop on a page load,there is no way around it.

• Solution: do not reload the page

• Bad solutions: Frames, Flash, Pop-up Windows

• Better solution: AJAX

• Small site = content on one page, animateLarge site = AJAX load other pages

OK...

HERE’S THE RUB

45

Page 46: Solving Common Client Requets with jQuery Presentation (v2)

46

Page 47: Solving Common Client Requets with jQuery Presentation (v2)

47

Page 48: Solving Common Client Requets with jQuery Presentation (v2)

48

Page 49: Solving Common Client Requets with jQuery Presentation (v2)

49

Page 50: Solving Common Client Requets with jQuery Presentation (v2)

And now...

HOT PLUGIN ACTIONurlInteralAddress

http://cl.ly/3B9j http://cl.ly/3BFZ

50

Page 51: Solving Common Client Requets with jQuery Presentation (v2)

http://cl.ly/3B1F

51

Page 52: Solving Common Client Requets with jQuery Presentation (v2)

52

Page 53: Solving Common Client Requets with jQuery Presentation (v2)

• The music never stops ifthe page never reloads

• Maintain user expectations(Like their back button working)

• No JavaScript? Like nothing ever happened

• Enforcement of structure(Deep link entrances)

Quick recap of...

AJAXIFICATION

53

Page 54: Solving Common Client Requets with jQuery Presentation (v2)

#5

SLIP SLIDING AWAY

Hey Chris,When you click links that go down the page, can the page slide down instead of jump?

54

Page 55: Solving Common Client Requets with jQuery Presentation (v2)

http://cl.ly/3Eyb

55

Page 56: Solving Common Client Requets with jQuery Presentation (v2)

• The journey: http://cl.ly/3FYq

• Plugin: http://cl.ly/3FFV

• Fancy plugin: http://cl.ly/3F2t

• Video tutorial / Fixed Navigation: http://cl.ly/3F67

• “Slider”: http://cl.ly/3Fab

Unfortunately that wasn’t...

THE WHOLE STORY

56

Page 57: Solving Common Client Requets with jQuery Presentation (v2)

Thanks!

57