Search

5/08/2008

Ajaxian » Unobtrusive JavaScript with jQuery

Ajaxian » Unobtrusive JavaScript with jQuery

Rather than hoping for graceful degradation, PE builds documents for the least capable or differently capable devices first, then moves on to enhance those documents with separate logic for presentation, in ways that don't place an undue burden on baseline devices but which allow a richer experience for those users with modern graphical browser software. Progressive enhancement
Steven Champeon and Nick Finck, 2003

• Build a site that works without JavaScript
• Use JavaScript to enhance that site to provide a better user experience: easier to
interact with, faster, more fun
• Start with Plain Old Semantic HTML
• Layer on some CSS (in an external stylesheet) to apply the site’s visual design
• Layer on some JavaScript (in an external script file) to apply the site’s enhanced behaviour

bad:
Have you read our<a href="#" onclick="window.open('terms.html', 'popup', 'height=500,width=400,toolbar=no'); return false;" >terms and conditions</a>?
better:
Have you read our <a href="terms.html" onclick="window.open('terms.html', 'popup','height=500,width=400,toolbar=no'); return false;">terms and conditions</a>?
event better:
Have you read our<a href="terms.html"
onclick="window.open(this.href, 'popup','height=500,width=400,toolbar=no'); return false;">terms and conditions</a>?

沒有留言: