Unobtrusive JavaScript

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    5 Favorites & 3 Groups

    Unobtrusive JavaScript - Presentation Transcript

    1. Unobtrusive JavaScript
    2. Dave Verwer http://daveverwer.com http://shinydevelopment.com
    3. What is UJS?
    4. Did it have full functionality? No Was it as quick? No Was it as pretty? No Was it as usable? No Did it basically work? Yes
    5. Why should you care?
    6. Accessibility
    7. Mobile Browsing
    8. SEO
    9. As of 1st September 2005, every web site built for a dutch government agency is required by law to conform to: Valid HTML 4.01 or XHTML 1.0 CSS and semantic HTML and separation of structure and presentation Progressive enhancement The W3C DOM (instead of the old Microsoft document.all) Meaningful values of class and id Meaningful alt attributes on all images Scripts that work on links should extend the basic link functionality (think accessible popups) If a link makes no sense without a script, it shouldn't be in the HTML (but be generated by JavaScript) Use of forms or scripts as the only means of getting certain information is prohibited Removing the focus rectangle on links is prohibited Information offered in a closed format (think Word) should also be offered in an open format The semantics of many HTML elements are explicitly defined
    10. Point 3: Progressive Enhancement.
    11. Point 7: Scripts that work on links should extend the basic link functionality.
    12. Point 8: If an element makes no sense without a script, it shouldn't be in the HTML.
    13. Point 9: Use of forms or scripts as the only means of getting certain information is prohibited.
    14. So JavaScript is evil, right?
    15. Good JavaScript
    16. Bad JavaScript
    17. The Dark Ages of the Web
    18. Separating content from design
    19. <b><font size=\"5\"><font color=\"#0000FF\">THIS SITE IS UNDER CONSTRUCTION!!</font></font></b> <style> p.construction { color: #00f; font-size: 1.5em; font-weight: bold; } </style> <p class=\"construction\"> THIS SITE IS UNDER CONSTRUCTION!! </p>
    20. Separating content from design and behaviour
    21. target=“_blank” demo
    22. Prototype & LowPro
    23. <a class=“external”>
    24. Event.addBehavior({ \"a.external:click\": function(event) { window.open(this.href, \"ext\"); return false; } });
    25. Setting a class becomes an indicator of behaviour not just style
    26. Make sure nothing breaks
    27. Start minimal and show UI or Start big and hide UI
    28. JS Specific demo UI
    29. UJS plugin for demo Rails
    30. Summary
    31. Does it really need it?
    32. Do links still work?
    33. Does this break the back button?
    34. Don’t rely on alert() for confirmations
    35. Scripts hidden away when possible?
    36. Enhancing Accessibility with JavaScript?!?
    37. Questions? dave.verwer@shinydevelopment.com

    + daveverwerdaveverwer, 3 years ago

    custom

    3259 views, 5 favs, 2 embeds more stats

    Unobtrusive JavaScript

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 3259
      • 3062 on SlideShare
      • 197 from embeds
    • Comments 0
    • Favorites 5
    • Downloads 189
    Most viewed embeds
    • 196 views on http://www.jcargoo.org
    • 1 views on http://ohisee.com

    more

    All embeds
    • 196 views on http://www.jcargoo.org
    • 1 views on http://ohisee.com

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories