Uploaded on

A brief introduction to unobtrusive JavaScript.

A brief introduction to unobtrusive JavaScript.

More in: Education , Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
803
On Slideshare
0
From Embeds
0
Number of Embeds
1

Actions

Shares
Downloads
9
Comments
0
Likes
1

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Unobtrusive JavaScript
    Brett Millett
    October 6th, 2011
  • 2. What is JavaScript?
    Powerful scripting language that your web browser executes.
    Built into every major web browser.
    Standardized (for the most part) for all web browsers.<script>alert(“hello world!”);</script>
  • 3. Why JavaScript?
    • Makes rich interaction possible with a webpage!
    • 4. AJAX: asynchronous JavaScript and XML.
    • 5. The Internet would be a far less interesting place without it.
  • What’s “obtrusive” JavaScript?
    HTML markup allows use of JavaScript via event attributes. The “old way” and an “obtrusive” JavaScript practice.
  • 6. What’s so bad about that?
    Web pages are easier to update when functionality and layout are uncoupled.
    JavaScript must be part of the document body instead of in a cacheable external file.
    href=“#” example when JavaScript disabled.
    Everybody code like it’s 1999!
  • 7. What’s unobtrusive JavaScript?
    Separates behavior from markup.
    Allows for “graceful degradation.”
  • 8. Unobtrusive JavaScript Example
    • Completely separate from markup.
    • 9. Reusable and globally accessible. Easier to change one function then all your markup!
    • 10. Degrades gracefully.
  • jQuery (jquery.com)
    Popular JavaScript framework.
    Extremely powerful selector syntax.
  • 11. Guidelines for accessibility
    Build a website without any JavaScript.
    Once the website functions without JavaScript, use JavaScript to enhance the user experience.
    Easier interaction
    Performance
    Fun
    These guidelines only make sense when using unobtrusive JavaScript!
  • 12. Questions?