• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
ajax
 

ajax

on

  • 347 views

this is ajax presentation.

this is ajax presentation.

Statistics

Views

Total Views
347
Views on SlideShare
347
Embed Views
0

Actions

Likes
0
Downloads
4
Comments
0

0 Embeds 0

No embeds

Accessibility

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • Flickr is a photo sharing application, BaseCamp is a project management application, Kayak is a airline flight search tool.
  • This page contains two images showing the use AJAX on the Yahoo! Sports page from the 2006 Olympics. The first image shows the entry field for a query to find athletes and countries with “mi” entered into the field. Below the field is a drop down box with a list of possible athletes provided by Yahoo, The list includes Micheal Lundmark, Michael Greis, Michael Gruber, Michael Gufler and 11 other entries for athletes whose names are Michael. In addtion to the name, the list also include the country and sport for the athlete. The second image shows the same input field with an additional letter “l” added at the end of “mi”. The drop down list of choices now contains the following; Milaine Theriault, Milan Hejduk, Milan Hnilicka, Milan Jagnesak, and other athletes whose first of last name begins with the letters “mil”. Miller, Bode, the US Alpine Skier is also included in the list.
  • This diagram shows a traditional web interaction. The user makes an http request which is processed by the server and a new page is returned. The idea is that each request returns an entire page to the browser.
  • This diagram illustrates AJAX style interactions. In this case JavaScript is used to make an http request for specific information. The web server processes the request and returns the specific information. JavaScript on the page integrates that information into the current page. The idea is that rather than an entire page being returned, a piece of information is returned and integrated into the page. This can happen many times on each page.
  • AJAX creates a new paradigm for the web and many people are not accustomed to it yet. Thus it is important to inform the user if the page is being incrementally updated. Some users may not notice that data on the page is changed. This is especially true for users of assistive technology such as screen readers and magnifiers. Due to assistive technology, cognitive, or other reasons, some users may be focused on only a single area of the page. These uses may not be able to easily locate new information on the page. Unexpected changes of focus can be very distracting for some users. It can be very time consuming and difficult for some users to return to the previous location on the page. Thus, changing focus to the updated content should be avoided unless the user has explicitly requested that mechanism of update notification. Also, note that WCAG 2.0 Success Criterion 3.2.5 states, “ Changes of context are initiated only by user request.” Loss of back button functionality and URIs that can not be bookmarked are also issues associated with AJAX but they will not be discussed in this presentation since they do not directly affect accessibity.
  • WCAG 2.0 Success Criterion 2.2.5 states, “ Interruptions, such as updated content, can be postponed or suppressed by the user, except interruptions involving an emergency .”
  • WCAG Level 2 success criterion 2.2.2 Content does not blink for more than 3 seconds, or a method is available to stop any blinking content in the delivery unit . WCAG level 1 success criterion 2.3.1 Content does not violate the general flash threshold or the red flash threshold.
  • All of these techniques will be demonstrated. Updates via an alert or setting focus to new data can be very annoying or disorienting and thus should only be implemented at the user’s request. Most assistive technologies and some browsers provide a mechanism to navigate via HTML headers.
  • In Firefox 1.5 and IE 5 and later, the tabindex attribute can be added to any element to give it keyboard focus. Tabindex=0 puts the element in the default tab order; tabindex >0 puts the element in the specific position in the tab order. Tabindex < 0 allows the element to receive focus programmatically.

ajax ajax Presentation Transcript

  • JavaScript and AJAX Accessibility Becky Gibson Web Accessibility Architect
  • Agenda
    • What is AJAX and why do I care?
    • What are the Issues with AJAX?
    • How do I make my AJAX applications Accessible?
      • Using HTML Techniques
      • Using DHTML Accessibility Techniques
    • Demonstration of techniques
    • Summary
  • What is AJAX?
    • AJAX = Asynchronous JavaScript and XML
    • Allows incremental update of Web pages.
    • Built using standard web technologies - HTTP, (X)HTML, CSS, JavaScript, Document Object Model (DOM), XML
    • Used by many popular internet companies.
    • Examples:
      • Google Suggests, Google & Yahoo! Maps
      • Amazon A9 Search
      • Flickr, BaseCamp, Kayak
      • Yahoo! AJAX Library
  • Example – Yahoo! Sports
  • Traditional Web Interaction Client makes http request Web server Server returns a new page
  • How AJAX works Web server Client makes http request for specific information Server returns the requested information Multiple requests are served
  • Why Do I Care About AJAX?
    • Enables building Rich Internet Applications (RIA)
    • Allows dynamic interaction on the Web
    • Improves performance
    • Real-time updates
    • No plug-ins required
  • What are the Issues with AJAX?
    • User does not know updates will occur.
    • User does not notice an update.
    • User can not find the updated information.
    • Unexpected changes in focus.
    • Loss of Back button functionality*.
    • URIs can not be bookmarked*.
    *These issues will not be discussed as they are not specific to accessibility.
  • Specific Accessibility Issues
    • Assistive Technology users are not aware of updates
      • Updates occur on a different section of the page than the user is currently interacting with.
      • Clicking a link updates a different section of the page.
      • Auto-complete fields or generated options not available to assistive technology.
      • User has no idea how to find new or updated content
      • Changes in focus prohibit complete review of the page
      • Changes in focus cause disorientation and additional navigation.
  • Informing the User
    • Explain the interaction to the user
      • Before accessing the AJAX enabled page
      • Within the AJAX enabled page
    • Where possible, provide a manual update option
      • Necessary for WCAG 2.0 Guideline 2.2
    • Save the user’s update preference
  • Make updates Noticeable
    • Change the background color of updated data
      • Use a subtle color
      • Change only for a few seconds
      • Best for small areas of the page
    • Briefly blink the updated data
      • Blink for 3 seconds or less (WCAG 2.0 Guideline 2.2)
      • Avoid the flash threshold (WCAG 2.0 Guideline 2.3)
  • Help Users Find Updated Information
    • Provide option for updates via an Alert
    • Provide option to set focus to new data.
    • Use HTML header tags to mark sections with updated content.
    • Use DHTML Accessibility Alert role in conjunction with a floating pop-up box.
    • Use DHTML Accessibility Description role to describe new content.
  • DHTML Accessibility Techniques and AJAX
    • DTHML Accessibility allows the creation of desktop style widgets on the web
    • Full keyboard navigation without excessive use of the tab key
    • Allows easy navigation from component to component and to updated content.
    • Allows non-intrusive notification of updated content via Alert
  • DHTML Accessibility Overview
    • Add keyboard event handling
    • Add role and state information
    • Make items focusable via tabindex attribute
    • Update state information dynamically
  • DHTML Accessibility Overview (continued)
    • Works in HTML or XHTML
      • XHTML
        • Uses XHTML 1.x role attribute
        • Uses namespaces to add state attributes
      • HTML
        • Embeds role and state information into class attribute
        • Accessibility Script library sets the role and state using DOM apis
  • Example using XHTML <html lang=&quot;en&quot; xml:lang=&quot;en&quot; xmlns=&quot;http://www.w3.org/TR/xhtml2&quot; xmlns:wairole=&quot;http://www.w3.org/2005/01/wai-rdf/GUIRoleTaxonomy#&quot; xmlns:waistate=&quot;http://www.w3.org/2005/07/aaa&quot; > ……… .. <span id=&quot;slider&quot; class=&quot;myslider myselector2&quot; role=&quot;wairole:slider&quot; waistate:valuemin=&quot;0&quot; waistate:valuemax=&quot;50&quot; waistate:valuenow=&quot;33&quot; > </span>
  • Example Using HTML <!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot; &quot;http://www.w3.org/TR/html4/loose.dtd&quot; > <html lang=&quot;en&quot;> <head> <script type=&quot;text/javascript&quot; src=&quot;enable.js&quot;></script> </head> ……………….. <span id=&quot;slider&quot; tabindex=&quot;0&quot; class=&quot;myslider myselector2 axs slider valuemin-0 valuemax-50 valuenow-33 &quot; > </span> Technique described at: http://www.w3.org/WAI/PF/adaptable/HTML4/embedding-20060318.html
  • Summary
    • AJAX is a powerful technology for making dynamic web applications.
    • AJAX applications can present Accessibility barriers.
    • Simple changes to application design can make AJAX usable for all.
    • DHTML Accessibility Techniques fit well with AJAX
  • Questions? Further Discussion in Marriott Executive Suite 1 (18 th Floor) 3:30-4:00pm March 24 (today)
  • Sample Code for Changing Styles <style type=&quot;text/css&quot;> .notice { background-color:#FFFFCC; } .roInput { border:none; background-color:#FFFFFF; } </style> <script type=&quot;text/javascript&quot;> // get the element to hold updated data var priceLoc = document.getElementById('priceLoc&quot;); // update the data in price loc priceLoc.value = &quot;new data&quot;; // set the style so change will be noticed priceLoc.className = &quot;notice&quot;; // create timer to call clearActive() with element id and style name setTimeout(&quot;clearActive('priceLoc','roInput');&quot;, 5000); function clearActive(activeId, resetStyle) { var curActive = document.getElementById(activeId); curActive.className = resetStyle; } </script>