Unobtrusive Javascript - SD.rb 2007

3,835 views
3,752 views

Published on

Unobtrusive Javascript

Published in: Business, Technology
0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
3,835
On SlideShare
0
From Embeds
0
Number of Embeds
27
Actions
Shares
0
Downloads
124
Comments
0
Likes
4
Embeds 0
No embeds

No notes for slide

Unobtrusive Javascript - SD.rb 2007

  1. 1. Unobtrusive JavaScript behavior oriented JS with graceful degradation progressive enhancement matt aimonetti - SDRuby - Dec 2007 http://railsontherun.com 1
  2. 2. 2
  3. 3. Graceful Degradation 3
  4. 4. • create a page that works with and without javascript • page degrades to a less advanced one if javascript isn’t enabled in the browser 4
  5. 5. Progressive Enhancement 5
  6. 6. • graceful degradation is good but... • first build the basic functionality available to all • then build advanced features on top of the foundations 6
  7. 7. how? 7
  8. 8. • register event handlers programmatically • use CSS selectors to select the elements to register • keep things separate 8
  9. 9. V from MVC 9
  10. 10. • Structure: HTML • Presentation: CSS 10
  11. 11. • Structure: HTML • Presentation: CSS • Behavior: JavaScript Keep the layers separate 11
  12. 12. structure: 12
  13. 13. presentation: 13
  14. 14. behavior: 14
  15. 15. JQuery + livequery 15
  16. 16. Prototype + LowPro 16
  17. 17. resources • http://prototypejs.org • http://danwebb.net/lowpro • http://lowpro.stikipad.com/ • http://groups.google.co.uk/group/low-pro?hl=en • http://jquery.com/ • http://brandonaaron.net/docs/livequery/ • http://railsontherun.com 17

×