Avoiding the
       JavaScript:void(''):
Accommodating 1.0 Users in a Web 2.0
             World




         Jason Pitoniak
Rochester Institute of Technology

    HighEdWebDev ▪ TPR 4
       October 15, 2007
What's wrong with this code?



     <a href= “javascript:void('')” onclick=
“window.open('popup.html', 'popup', height=500,
     width=300);”>more information</a>
What is a 1.0 User?

Any user who, for whatever reason, cannot take
advantage the the advanced features of the sites we
build .

1.0 Users include:
 Users with JavaScript turned off
 Users of older browsers
 Users of mobile devices
 Users of assistive technology devices
Problems? What problems?

What kind of problems arise from using advanced
web design techniques?

     The site stops working if...

Can it be solved?

     Of course...that's why you're here,
     isn't it?
Example of a Problem
Yahoo!'s popular Upcoming.org community events
 database uses an advanced AJAX/JavaScript
 interface to let event organizers select venues.
What happens when you try to add an event without
 JavaScript support? Let's see...
What you won't learn today...
This is not a general accessibility lecture.

This is not a lecture on web standards, JavaScript,
 AJAX, or any related technology.

You will not learn the “best” way to create an
 accessible Web 2.0 site.
But you will leave with unanswered questions!
Some Questions

Is there a difference between a
web site and a web application?
Some Questions

             Is it acceptable to launch two
             versions of a web application?

Text-only pages are generally considered a bad idea
We launch Mac and PC versions of software
Google Maps and GMail
APIs/MVC to the rescue?
Hints for Doing it Right
Understand your audience
Code like it's 1999
Use DOM scripting to enhance the page
on the client
Consider using a JavaScript library
Understand Your Audience
An app that will be restricted to only the
computers in the registrar's office probably
doesn't need to be coded with mobile devices in
mind.
An app for students to check their homework
assignments probably should.
Both apps should address the needs of users with
disabilities.
Code Like It's 1999
Think lowest common denominator when
designing your basic page structure.
Follow web standards to ensure consistant
display.
Use DOM Scripting
Newer browsers can manipulate the page on the
client end.
Add the bells and whistles through JavaScript.
If a browser doesn't understand the manipulations
they will be ignored, but the user will have a
fulling working page nonetheless.
DOM Scripting Limitations
Many irregularities still exist between platforms
Proper care must be taken to prevent script errors
in older JS compliant browsers.
Consider a JavaScript Library
JavaScript libraries...
  Standardize browser irregularities
  Add support for “missing” events
  Often provide easy-to-use AJAX interfaces
  Sometimes provide cool widgets and page
  enhancements
JS Libraries: Many to Choose
And the Winner is...
Y I Chose YUI
Open source (BSD license)‫‏‬
Developed by Yahoo! for use on their properties
Actively being developed
DOM utilities, AJAX handlers, and widgets
Extremely flexible API
Lightweight
Namespacing system prevents naming conflicts
YUI Features
Standardized event model
onAvailable, onContentReady, and
onDOMReady events
DOM utilities like getElementsByClassName()‫‏‬
Many UI widgets: calendars, auto completes,
tabs, menus, data grids, color picker, etc.
YUI Issues
Namespacing model makes for very long lines of
code:
YAHOO.widget.calendar(...);
Flexible API = lots of doing things by hand
Componentialized code makes for lots of JS files
to include on web pages.
AJAX: The Web Developer's
       Four Letter Word
OMG, you used AJAX in an accessibility lecture!
Is AJAX really inaccessible?
If not, then what is?
But, you used DOM scripting in the example!
Avoiding DOM Scripting*
     Can we expect users that don't want advanced
     features of our sites to turn off JavaScript?
     Do we use JS in beneficial ways that don't
     manipulate the DOM?
     Is posting instructions on how to turn off JS a
     reasonable way to make our app accessible?



*when necessary
Accessibility Mode
Consider options to let users turn advanced, non-
acessible features off
−   Top of all pages?
−   On a user preferences page?
Simple check box and cookie?
Thoughts on Screen Readers
Screen readers tend not to notice runtime changes
in the DOM
Screen readers DO understand JavaScript
Screen readers DO understand CSS
Screen readers DON'T like JS “panels”
Screen readers DO work with popup windows
The Solution
<a href= “info.html” id=“mypopup”>more info</a>
document.getElementById(“mypopup”).onclick =
  function (e) {
      e = (window.event) ? window.event : e;
      window.open(this.href, “popup”,
        “height=200,width=300”);
      e.preventDefault();
  }
Yellow Box
When changing anything on the page, highlight it
with a yellow background
Fade the background to white slowly
Helps low-sighted users follow changes to the
page
Originally used by Basecamp
http://webiscope.com/archives/2007/09/19/how-usability-affects-products-part-2-
basecamp/
Accessibility Links
WAI: http://www.w3.org/WAI/
Section 508: http://www.section508.gov/
NYS Web Accessibility Standard:
http://www.oft.state.ny.us/policy/s04-001/index.htm
Mobile Device Links
W3C MobileOK Tests:
http://www.w3.org/TR/mobileOK-basic10-tests/
Challenges of Interface Design for Mobile
Devices:
http://yuiblog.com/blog/2007/10/02/challenges-
of-interface-design-for-mobile-devices/
JavaScript Library Links
YUI: http://developer.yahoo.com/yui
Prototype: http://www.prototypejs.org/
Scriptaculous: http://script.aculo.us/
jQuery: http://www.jquery.com/
DEDChain: http://dedchain.dustindiaz.com/
MooFX: http://moofx.mad4milk.net/
Adobe Spry: http://labs.adobe.com/technologies/spry/
Mochikit: http://mochikit.com/
Dojo: http://dojotoolkit.org/
Ext: http://extjs.com/
In Conclusion
Understand your audience
Code for the LCD
Modify on the client when the client supports it
and the user wants it
Consider accessibility issues and work-arounds
Only exploit technology when it serves a
legitimate purpose

More Related Content

PDF
10 Simple Rules for Making My Site Accessible
PPTX
5 single page application principles developers need to know
PPT
Best And Worst Practices Building Ria with Adobe and Microsoft
PPTX
Make mobile web apps rock
PPTX
How To Be an HTML5 Mobile Cloud Champion
PPT
Techniques For A Modern Web UI (Original Slides)
PDF
Bruce Lawson Opera Indonesia
10 Simple Rules for Making My Site Accessible
5 single page application principles developers need to know
Best And Worst Practices Building Ria with Adobe and Microsoft
Make mobile web apps rock
How To Be an HTML5 Mobile Cloud Champion
Techniques For A Modern Web UI (Original Slides)
Bruce Lawson Opera Indonesia

What's hot (20)

PPTX
10 things to make you a Great Mobile Web Developer
PDF
Intro to Web Development from Bloc.io
PPTX
WebMatrix jQuery Mobile Web
PPTX
From desktop to mobile web
PDF
Now you see me... Adaptive Web Design and Development
PDF
Why Game Developers Should Care About HTML5
PDF
Mobile tech briefing 2013
PDF
Accessibility in pattern libraries
PPT
Using Ajax to improve your user experience at Web Directions South 2009
PDF
Beyond Responsive Web Design
PDF
Accessibility - A feature you can build
PPTX
That's crazy! how to build single page web apps
PPT
Mobile app with sencha touch
PDF
501 Talks Tech: WordPress for Nonprofits
PDF
How to build a website... the accessible way
PPT
Wordpress To Go Democamp Mtl2009
PPTX
20 mLearning Tools in 60 Minutes - mLearnCon 2010
PDF
Responsive web design
PDF
Web Accessibility - A feature you can build
PPTX
How HTML5 and WAI-ARIA Can Improve Virtual Space of Universities
10 things to make you a Great Mobile Web Developer
Intro to Web Development from Bloc.io
WebMatrix jQuery Mobile Web
From desktop to mobile web
Now you see me... Adaptive Web Design and Development
Why Game Developers Should Care About HTML5
Mobile tech briefing 2013
Accessibility in pattern libraries
Using Ajax to improve your user experience at Web Directions South 2009
Beyond Responsive Web Design
Accessibility - A feature you can build
That's crazy! how to build single page web apps
Mobile app with sencha touch
501 Talks Tech: WordPress for Nonprofits
How to build a website... the accessible way
Wordpress To Go Democamp Mtl2009
20 mLearning Tools in 60 Minutes - mLearnCon 2010
Responsive web design
Web Accessibility - A feature you can build
How HTML5 and WAI-ARIA Can Improve Virtual Space of Universities
Ad

Viewers also liked (8)

PDF
PDF
Lab_2_2009
PDF
tutorial7
PDF
Tesi_Adamou
PDF
R31%20Strong%20A%20Web-based%20Comparative%20Genomics%20tutorial%20Microbiolo...
PDF
Tutorial%20-%20Content%20Management%20System
PDF
PDF
T11_effects_of_peripheral_stim
Lab_2_2009
tutorial7
Tesi_Adamou
R31%20Strong%20A%20Web-based%20Comparative%20Genomics%20tutorial%20Microbiolo...
Tutorial%20-%20Content%20Management%20System
T11_effects_of_peripheral_stim
Ad

Similar to TPR4 (20)

PPT
Techniques For A Modern Web UI (With Notes)
PPT
Ajax Abuse Todcon2008
PDF
Professional web development with libraries
PPT
Advantages and disadvantages of an ajax based client application
PPT
(In)Security Implication in the JS Universe
PPT
Responsive web design & mobile web development - a technical and business app...
PPT
Skill Session - Web Multi Device
PPT
Developing For The Web
PDF
Making your site mobile-friendly - DevCSI Reading 21.07.2010
PDF
orcreatehappyusers
PDF
orcreatehappyusers
PDF
Real solutions, no tricks
PDF
BACnet HMI5 - BACnet Touch Panel - BACnet Touch Screen - HMI
PPTX
Front End Development | Introduction
PDF
HTML5 Can't Do That
PPTX
Doing Modern Web, aka JavaScript and HTML5 in the Enterprise NYC Code Camp
PDF
Bruce lawson-over-the-air
PDF
Fewd week4 slides
PPT
iWeb NJECC June 28, 2011 DAndrea
PDF
Seven Steps To Better JavaScript
Techniques For A Modern Web UI (With Notes)
Ajax Abuse Todcon2008
Professional web development with libraries
Advantages and disadvantages of an ajax based client application
(In)Security Implication in the JS Universe
Responsive web design & mobile web development - a technical and business app...
Skill Session - Web Multi Device
Developing For The Web
Making your site mobile-friendly - DevCSI Reading 21.07.2010
orcreatehappyusers
orcreatehappyusers
Real solutions, no tricks
BACnet HMI5 - BACnet Touch Panel - BACnet Touch Screen - HMI
Front End Development | Introduction
HTML5 Can't Do That
Doing Modern Web, aka JavaScript and HTML5 in the Enterprise NYC Code Camp
Bruce lawson-over-the-air
Fewd week4 slides
iWeb NJECC June 28, 2011 DAndrea
Seven Steps To Better JavaScript

More from tutorialsruby (20)

PDF
&lt;img src="../i/r_14.png" />
PDF
TopStyle Help &amp; &lt;b>Tutorial&lt;/b>
PDF
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>
PDF
&lt;img src="../i/r_14.png" />
PDF
&lt;img src="../i/r_14.png" />
PDF
Standardization and Knowledge Transfer – INS0
PDF
xhtml_basics
PDF
xhtml_basics
PDF
xhtml-documentation
PDF
xhtml-documentation
PDF
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
PDF
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
PDF
HowTo_CSS
PDF
HowTo_CSS
PDF
BloggingWithStyle_2008
PDF
BloggingWithStyle_2008
PDF
cascadingstylesheets
PDF
cascadingstylesheets
&lt;img src="../i/r_14.png" />
TopStyle Help &amp; &lt;b>Tutorial&lt;/b>
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>
&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />
Standardization and Knowledge Transfer – INS0
xhtml_basics
xhtml_basics
xhtml-documentation
xhtml-documentation
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
HowTo_CSS
HowTo_CSS
BloggingWithStyle_2008
BloggingWithStyle_2008
cascadingstylesheets
cascadingstylesheets

Recently uploaded (20)

PDF
Taming the Chaos: How to Turn Unstructured Data into Decisions
PDF
A comparative study of natural language inference in Swahili using monolingua...
PPTX
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
PDF
A review of recent deep learning applications in wood surface defect identifi...
PDF
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
PDF
August Patch Tuesday
PDF
STKI Israel Market Study 2025 version august
PPTX
Web Crawler for Trend Tracking Gen Z Insights.pptx
PPTX
Modernising the Digital Integration Hub
PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PPTX
The various Industrial Revolutions .pptx
PDF
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
PDF
Developing a website for English-speaking practice to English as a foreign la...
PPTX
observCloud-Native Containerability and monitoring.pptx
PPTX
Chapter 5: Probability Theory and Statistics
PDF
DP Operators-handbook-extract for the Mautical Institute
PDF
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
PDF
A novel scalable deep ensemble learning framework for big data classification...
PDF
A contest of sentiment analysis: k-nearest neighbor versus neural network
PDF
Zenith AI: Advanced Artificial Intelligence
Taming the Chaos: How to Turn Unstructured Data into Decisions
A comparative study of natural language inference in Swahili using monolingua...
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
A review of recent deep learning applications in wood surface defect identifi...
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
August Patch Tuesday
STKI Israel Market Study 2025 version august
Web Crawler for Trend Tracking Gen Z Insights.pptx
Modernising the Digital Integration Hub
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
The various Industrial Revolutions .pptx
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
Developing a website for English-speaking practice to English as a foreign la...
observCloud-Native Containerability and monitoring.pptx
Chapter 5: Probability Theory and Statistics
DP Operators-handbook-extract for the Mautical Institute
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
A novel scalable deep ensemble learning framework for big data classification...
A contest of sentiment analysis: k-nearest neighbor versus neural network
Zenith AI: Advanced Artificial Intelligence

TPR4

  • 1. Avoiding the JavaScript:void(''): Accommodating 1.0 Users in a Web 2.0 World Jason Pitoniak Rochester Institute of Technology HighEdWebDev ▪ TPR 4 October 15, 2007
  • 2. What's wrong with this code? <a href= “javascript:void('')” onclick= “window.open('popup.html', 'popup', height=500, width=300);”>more information</a>
  • 3. What is a 1.0 User? Any user who, for whatever reason, cannot take advantage the the advanced features of the sites we build . 1.0 Users include: Users with JavaScript turned off Users of older browsers Users of mobile devices Users of assistive technology devices
  • 4. Problems? What problems? What kind of problems arise from using advanced web design techniques? The site stops working if... Can it be solved? Of course...that's why you're here, isn't it?
  • 5. Example of a Problem Yahoo!'s popular Upcoming.org community events database uses an advanced AJAX/JavaScript interface to let event organizers select venues. What happens when you try to add an event without JavaScript support? Let's see...
  • 6. What you won't learn today... This is not a general accessibility lecture. This is not a lecture on web standards, JavaScript, AJAX, or any related technology. You will not learn the “best” way to create an accessible Web 2.0 site. But you will leave with unanswered questions!
  • 7. Some Questions Is there a difference between a web site and a web application?
  • 8. Some Questions Is it acceptable to launch two versions of a web application? Text-only pages are generally considered a bad idea We launch Mac and PC versions of software Google Maps and GMail APIs/MVC to the rescue?
  • 9. Hints for Doing it Right Understand your audience Code like it's 1999 Use DOM scripting to enhance the page on the client Consider using a JavaScript library
  • 10. Understand Your Audience An app that will be restricted to only the computers in the registrar's office probably doesn't need to be coded with mobile devices in mind. An app for students to check their homework assignments probably should. Both apps should address the needs of users with disabilities.
  • 11. Code Like It's 1999 Think lowest common denominator when designing your basic page structure. Follow web standards to ensure consistant display.
  • 12. Use DOM Scripting Newer browsers can manipulate the page on the client end. Add the bells and whistles through JavaScript. If a browser doesn't understand the manipulations they will be ignored, but the user will have a fulling working page nonetheless.
  • 13. DOM Scripting Limitations Many irregularities still exist between platforms Proper care must be taken to prevent script errors in older JS compliant browsers.
  • 14. Consider a JavaScript Library JavaScript libraries... Standardize browser irregularities Add support for “missing” events Often provide easy-to-use AJAX interfaces Sometimes provide cool widgets and page enhancements
  • 15. JS Libraries: Many to Choose
  • 16. And the Winner is...
  • 17. Y I Chose YUI Open source (BSD license)‫‏‬ Developed by Yahoo! for use on their properties Actively being developed DOM utilities, AJAX handlers, and widgets Extremely flexible API Lightweight Namespacing system prevents naming conflicts
  • 18. YUI Features Standardized event model onAvailable, onContentReady, and onDOMReady events DOM utilities like getElementsByClassName()‫‏‬ Many UI widgets: calendars, auto completes, tabs, menus, data grids, color picker, etc.
  • 19. YUI Issues Namespacing model makes for very long lines of code: YAHOO.widget.calendar(...); Flexible API = lots of doing things by hand Componentialized code makes for lots of JS files to include on web pages.
  • 20. AJAX: The Web Developer's Four Letter Word OMG, you used AJAX in an accessibility lecture! Is AJAX really inaccessible? If not, then what is? But, you used DOM scripting in the example!
  • 21. Avoiding DOM Scripting* Can we expect users that don't want advanced features of our sites to turn off JavaScript? Do we use JS in beneficial ways that don't manipulate the DOM? Is posting instructions on how to turn off JS a reasonable way to make our app accessible? *when necessary
  • 22. Accessibility Mode Consider options to let users turn advanced, non- acessible features off − Top of all pages? − On a user preferences page? Simple check box and cookie?
  • 23. Thoughts on Screen Readers Screen readers tend not to notice runtime changes in the DOM Screen readers DO understand JavaScript Screen readers DO understand CSS Screen readers DON'T like JS “panels” Screen readers DO work with popup windows
  • 24. The Solution <a href= “info.html” id=“mypopup”>more info</a> document.getElementById(“mypopup”).onclick = function (e) { e = (window.event) ? window.event : e; window.open(this.href, “popup”, “height=200,width=300”); e.preventDefault(); }
  • 25. Yellow Box When changing anything on the page, highlight it with a yellow background Fade the background to white slowly Helps low-sighted users follow changes to the page Originally used by Basecamp http://webiscope.com/archives/2007/09/19/how-usability-affects-products-part-2- basecamp/
  • 26. Accessibility Links WAI: http://www.w3.org/WAI/ Section 508: http://www.section508.gov/ NYS Web Accessibility Standard: http://www.oft.state.ny.us/policy/s04-001/index.htm
  • 27. Mobile Device Links W3C MobileOK Tests: http://www.w3.org/TR/mobileOK-basic10-tests/ Challenges of Interface Design for Mobile Devices: http://yuiblog.com/blog/2007/10/02/challenges- of-interface-design-for-mobile-devices/
  • 28. JavaScript Library Links YUI: http://developer.yahoo.com/yui Prototype: http://www.prototypejs.org/ Scriptaculous: http://script.aculo.us/ jQuery: http://www.jquery.com/ DEDChain: http://dedchain.dustindiaz.com/ MooFX: http://moofx.mad4milk.net/ Adobe Spry: http://labs.adobe.com/technologies/spry/ Mochikit: http://mochikit.com/ Dojo: http://dojotoolkit.org/ Ext: http://extjs.com/
  • 29. In Conclusion Understand your audience Code for the LCD Modify on the client when the client supports it and the user wants it Consider accessibility issues and work-arounds Only exploit technology when it serves a legitimate purpose