52
Do Try This at Home Ajax Bookmarking, Cross-site Scripting and Other Web 2.0 Browser Hacks Brian Dillard, Ajax R&D, Pathfinder Development 1

Do Try This At Home

Embed Size (px)

Citation preview

Page 1: Do Try This At Home

Do Try This at HomeAjax Bookmarking, Cross-site Scripting

and Other Web 2.0 Browser Hacks

Brian Dillard, Ajax R&D, Pathfinder Development

1

Page 2: Do Try This At Home

About this talk

1. Not too much code

2. The high-level stuff

3. The practical stuff

4. The uplifting finale

2

Page 3: Do Try This At Home

Where we are

It’s a really exciting time to be a web developer. Cool stuff is coming out every single day.

3

Page 4: Do Try This At Home

Where we are

... but it’s hard to get too excited about technologies

that aren’t yet ready for prime time. How best to participate?

4

Page 5: Do Try This At Home

Where we areWalled gardens

vs.ecosystems

5

Page 6: Do Try This At Home

Where we areOpen Web

vs.Closed Web

Jonathan Zittrain

6

Page 7: Do Try This At Home

Where we areAjaxvs.

Flash/Flexvs.

Silverlight

7

Page 8: Do Try This At Home

Where we arePrototype/Scriptaculous

vs.MooTools

vs.Dojo/Dijit/Dojox

vs.jQuery/jQuery UI

vs.YUI & Ext

8

Page 9: Do Try This At Home

Where we areWeb standards

vs."embrace,

extend, then innovate"

9

Page 10: Do Try This At Home

Where we areInternet Explorer 8

vs.Firefox 3

vs.Safari 3.1

vs.Opera 9.5

10

Page 11: Do Try This At Home

To get a better future, not only do we need a return to 'the browser wars,' we need to applaud and use the hell out of 'non-standard' features until such time as there’s a standard to cover equivalent functionality. Non-standard features are the future, and suggesting that they are somehow 'bad' is to work against your own self-interest.

Alex Russell, President, Dojo Foundation

“11

Page 12: Do Try This At Home

CSS masks!12

Page 13: Do Try This At Home

CSS variables!13

Page 14: Do Try This At Home

But ... Webkit? Safari?14

Page 15: Do Try This At Home

What should I do?

15

Page 16: Do Try This At Home

What's theright thing

to do?

What should I do?

16

Page 17: Do Try This At Home

What's theright thing

to do?

How should Iinvest my time?

What should I do?

17

Page 18: Do Try This At Home

The future liesin the tension

betweenemerging standards

and de facto standards

18

Page 19: Do Try This At Home

Today's technologies grew in the wild

• xmlHttpRequest

• DOMContentLoaded

• Selectors API

• Canvas supplanted SVG

• HTML5 Ajax Navigation

• Microformats

19

Page 20: Do Try This At Home

Tomorrow’s will grow ... in committees?

• HTML 5 in two dialects, HTML and XML

• XHTML 2

• ECMAScript 4 a.k.a. JavaScript 2

• CSS 3

• CSS Layout Module

• CSSOM

• DOM storage/client-side database storage

• Web Forms 2.0

20

Page 21: Do Try This At Home

Draft specsare cool ...

21

Page 22: Do Try This At Home

Draft specsare cool ...

but live implementations

are cooler.

22

Page 23: Do Try This At Home

The Gears project started because a group of developers at Google were frustrated by the slow march of web browsers. Competition and standards were producing fantastic results, but it took a long time to get implementations on every browser. In some cases, we still don’t have compatible implementations, years after the standards were finalized.

Aaron Boodman, Gears Engineer

“23

Page 24: Do Try This At Home

Who will play a role in determiningthe shape of tomorrow’s web?

• Proprietary runtimes set the pace for multimedia and native UI integration

• Standards bodies & browser vendors do their little dance

• Ajax libraries & browser plugins paper over the differences

24

Page 25: Do Try This At Home

Who will play a role in determiningthe shape of tomorrow’s web?

So what about individual developers?

25

Page 26: Do Try This At Home

Build cool stuff!

26

Page 27: Do Try This At Home

Offline storage• Dojo Storage

• Flash LSOs (Local Shared Objects)

• IE userData

• Form field auto-save

• Google Gears

• DOM storage: sessionStorage/globalStorage

• Client database storage

27

Page 29: Do Try This At Home

Cross-site scripting

• Doom and gloom from Crockford

• But XSS !== malware

• FF3 cross-window messaging with HTML 5 postMessage API

• xssinterface - a library that uses postMessage, Gears or a cookie hack

29

Page 30: Do Try This At Home

Other possibilities• CSSOM

• CSSOM View Module

• elementFromPoint for drag/drop

• Web Forms 2.0

• 2 projects in suspended animation

• Dust them off?

30

Page 31: Do Try This At Home

Best practices?• If you’re doing something simple, try to use the

draft-standard API itself.

• If you’re building a higher-level abstraction, use draft standards when they’re available.

• If you’re going for the big hack, follow the conventions of successful libraries.

• If you don’t need to rely on a specific JavaScript framework, don’t.

• Make informed choices about joining the fray.

31

Page 32: Do Try This At Home

Build plugins for popular frameworks.Solve a little problem well while looking to HTML 5.

How to be part of the conversation

32

Page 33: Do Try This At Home

Participate actively in open-source projects.You don’t need to build a Gears module to use one.

How to be part of the conversation

33

Page 34: Do Try This At Home

Get down and dirty with beta browsers.File bug reports. Join forums. Blog about it.

How to be part of the conversation

34

Page 35: Do Try This At Home

Read and comment on draft specs

How to be part of the conversation

35

Page 36: Do Try This At Home

Read and comment on draft specs... just not late at night.

How to be part of the conversation

36

Page 37: Do Try This At Home

Vote with your feet.Use technologies whose philosophy you support.

How to be part of the conversation

37

Page 38: Do Try This At Home

Become a beat reporter.

Tools for participating

38

Page 39: Do Try This At Home

Research tools• RSS: NetNewsWire/FeedDemon/GReader

• Oversubscribe

• labs.pathf.com/ajax/web20expo/

• Or just bookmark trusted sites

• ajaxian.com

• quirksmode.org

• crockford.com

39

Page 40: Do Try This At Home

Frequent browser vendor websites

Tools for participating

40

Page 42: Do Try This At Home

Debuggers for everyone...not just Firefox & Firebug

Tools for participating

42

Page 45: Do Try This At Home

Standards body websites

Tools for participating

45

Page 46: Do Try This At Home

Standards bodies• WC3

• http://www.w3.org/

• WHATWG

• http://www.whatwg.org/

• ECMAScript

• http://www.ecmascript.org/

46

Page 47: Do Try This At Home

Neither the CSS WG nor the HTML 5 WG nor, indeed, any W3C working group can define the future. They can only round off the sharp edges once the future becomes the past and that’s all we should ever expect of them. ... [T]he W3C cannot save us.

Alex Russell, President, Dojo Foundation

“47

Page 48: Do Try This At Home

If you wait for Google, Prototype, the WC3 and

Adobe to solve your problems, then you’re

missing out.

48

Page 49: Do Try This At Home

About me

• San Francisco: Reflect.com

• Chicago: United Airlines, Orbitz Worldwide

• Now: Pathfinder Development

• R&D: Playing with shiny new toys

• Blog: Agile Ajax (blogs.pathf.com/agileajax)

49

Page 50: Do Try This At Home

Please rate me!50

Page 51: Do Try This At Home

Please rate me!51

Page 52: Do Try This At Home

Please rate me!52