<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Code Couch &#187; Accessibility</title>
	<atom:link href="http://www.codecouch.com/category/accessibility/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.codecouch.com</link>
	<description>The ramblings of two code monkeys</description>
	<lastBuildDate>Thu, 19 Nov 2009 15:47:59 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to stop Internet Explorer from caching AJAX requests</title>
		<link>http://www.codecouch.com/2009/01/how-to-stop-internet-explorer-from-caching-ajax-requests/</link>
		<comments>http://www.codecouch.com/2009/01/how-to-stop-internet-explorer-from-caching-ajax-requests/#comments</comments>
		<pubDate>Sat, 31 Jan 2009 13:53:34 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[IE6]]></category>
		<category><![CDATA[IE7]]></category>
		<category><![CDATA[Internet Explorer]]></category>

		<guid isPermaLink="false">http://www.codecouch.com/?p=250</guid>
		<description><![CDATA[There are several ways to solve the problem of browsers caching AJAX requests. You can use a 'cache buster' parameter, or you can set the response headers server-side. This article discusses these two options.]]></description>
			<content:encoded><![CDATA[<p>I recently had to revisit the issue of IE&#8217;s default cache settings causing problems when making AJAX requests. Out-of-the-box, the cache setting is &#8216;Automatically&#8217;, where pages are only fetched from the server if the cached content is from an earlier day, old or from an earlier session.</p>
<p>This can be a nightmare to deal with, as you cannot ask all users of a web site to change their browser settings.</p>
<p>One workaround is to use a &#8216;cache buster&#8217; parameter in your GET request. Something like this:</p>

<div class="wp_syntax_outer"><div class="wp_syntax"><div class="wp_syntax_inner"><pre class="javascript" style="color: #000000;"><span class="kw2">var</span> urlToFetch <span class="sy0">=</span> <span class="st0">'whatever.php?randNum='</span> <span class="sy0">+</span> <span class="kw2">new</span> Date<span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">getTime</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></pre></div></div></div>

<p>This works very well, but can have drawbacks, depending on your server setup. For example, if your application server sits behind a caching layer, you wouldn&#8217;t want the URL to be different every time for idempotent requests, as the cached version would never get used, and so your application server would get a direct hit every time.</p>
<p>One way around this without using to parameters is to set the &#8216;Cache-Control&#8217; response header to direct the browser how to cache the response.</p>
<p>The &#8216;Cache-Control&#8217; header can have various values, one of which is &#8216;no-cache&#8217;. This tells the browser that it should not cache the response, so the next time the same URL is requested, new content will always be sent (as there is no previous version in the browser&#8217;s cache).</p>
<p>This is how we do it using Groovy:</p>

<div class="wp_syntax_outer"><div class="wp_syntax"><div class="wp_syntax_inner"><pre class="javascript" style="color: #000000;">response.<span class="me1">addHeader</span> <span class="st0">&quot;Cache-Control&quot;</span><span class="sy0">,</span> <span class="st0">&quot;max-age=0,no-cache,no-store&quot;</span></pre></div></div></div>

<p>So really, which method you use boils down to this: If you know that the cache buster will have a performance hit on your setup, then don&#8217;t use it, otherwise use whichever method you prefer.</p>
<p>Also, as a developer, I can highly recommend changing your IE cache settings to &#8216;Every visit to the page&#8217;.</p>
<div class="seeThrough h2Pod "><div class="seeThroughTop"><span class="tl"></span><span class="tr"></span><span class="t"></span></div><div class="seeThroughMiddle"><span class="r"></span><span class="l"></span><span class="m"></span><div class="seeThroughContent">
	<h2>Update 10/02/2008</h2>
</div></div><div class="seeThroughBottom"><span class="bl"></span><span class="br"></span><span class="b"></span></div></div>

<p>We&#8217;re finding that with some of our automated testing, IE 7 still caches the odd file now and then. To get around this, we have modified our &#8216;Cache-Control&#8217; header to include two non-standard properties, &#8216;post-check&#8217; and &#8216;pre-check&#8217;, and added an &#8216;Expires&#8217; header as well:</p>

<div class="wp_syntax_outer"><div class="wp_syntax"><div class="wp_syntax_inner"><pre class="javascript" style="color: #000000;">response.<span class="me1">addHeader</span> <span class="st0">&quot;Cache-Control&quot;</span><span class="sy0">,</span> <span class="st0">&quot;max-age=0,no-cache,no-store,post-check=0,pre-check=0&quot;</span><span class="sy0">;</span>
response.<span class="me1">addHeader</span> <span class="st0">&quot;Expires&quot;</span><span class="sy0">,</span> <span class="st0">&quot;Mon, 26 Jul 1997 05:00:00 GMT&quot;</span></pre></div></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.codecouch.com/2009/01/how-to-stop-internet-explorer-from-caching-ajax-requests/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Use CSS pseudo classes to enhance accessibility</title>
		<link>http://www.codecouch.com/2009/01/use-css-pseudo-classes-to-enhance-accessibility/</link>
		<comments>http://www.codecouch.com/2009/01/use-css-pseudo-classes-to-enhance-accessibility/#comments</comments>
		<pubDate>Tue, 20 Jan 2009 14:42:16 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://www.codecouch.com/?p=246</guid>
		<description><![CDATA[It is very simple to add some CSS rules to make your site more accessible. Read on to find out how you can use pseudo classes to provide extra support for keyboard users in all browsers (including Internet Explorer).]]></description>
			<content:encoded><![CDATA[<p>CSS pseudo-classes are probably not something most people are familiar with &#8211; although many developers would make use of them without necessarily being aware of it! When you hover the mouse over a link, many sites will underline the link for you. This is using the <strong>hover</strong> pseudo-class.</p>

<div class="wp_syntax_outer"><div class="wp_syntax"><div class="wp_syntax_inner"><pre class="javascript" style="color: #000000;">a <span class="br0">&#123;</span> text<span class="sy0">-</span>decoration<span class="sy0">:</span>none<span class="sy0">;</span> <span class="br0">&#125;</span>
a<span class="sy0">:</span>hover <span class="br0">&#123;</span> text<span class="sy0">-</span>decoration<span class="sy0">:</span>underline<span class="sy0">;</span> <span class="br0">&#125;</span></pre></div></div></div>

<p>The above example sets all anchors to have no underline text decoration, and the <strong>hover</strong> pseudo-class sets all anchors to have an underline on them. When the user hovers their mouse over a link, an underline will show under the link. When they move their mouse away, the <strong>hover</strong> pseudo-class stops taking effect and the underline is removed.</p>
<p>Pseudo-classes are supported with all modern browsers, but this support is only for the anchor element. Any attempt to use a pseudo-class on any other element will not work in Internet Explorer 6.</p>
<p>There are other pseudo-classes that can be used to provide a more usable experience for those that primarily use a keyboard to navigation through a page.  The first of these is the <strong>focus</strong> pseudo-class (which take affect when the element gains focus &#8211; such as tabbing to the element). This pseudo-class can be used to style elements when they receive focus.</p>
<p>Building on the initial example, the addition of a <strong>focus</strong> pseudo-class will ensure that the same hover effects (in this case some underline text decoration) are applied when the user tabs focus to the anchor.</p>

<div class="wp_syntax_outer"><div class="wp_syntax"><div class="wp_syntax_inner"><pre class="javascript" style="color: #000000;">a <span class="br0">&#123;</span> text<span class="sy0">-</span>decoration<span class="sy0">:</span>none<span class="sy0">;</span> <span class="br0">&#125;</span>
a<span class="sy0">:</span>hover<span class="sy0">,</span> a<span class="sy0">:</span><span class="kw3">focus</span> <span class="br0">&#123;</span> text<span class="sy0">-</span>decoration<span class="sy0">:</span>underline<span class="sy0">;</span> <span class="br0">&#125;</span></pre></div></div></div>

<p>This would be fine, except that Internet Explorer 6 doesn&#8217;t understand the <strong>focus</strong> pseudo-class at all! The solution is to use the <strong>active</strong> pseudo-class to extend the CSS rule.</p>

<div class="wp_syntax_outer"><div class="wp_syntax"><div class="wp_syntax_inner"><pre class="javascript" style="color: #000000;">a <span class="br0">&#123;</span> text<span class="sy0">-</span>decoration<span class="sy0">:</span>none<span class="sy0">;</span> <span class="br0">&#125;</span>
a<span class="sy0">:</span>hover<span class="sy0">,</span> a<span class="sy0">:</span><span class="kw3">focus</span><span class="sy0">,</span> a<span class="sy0">:</span>active <span class="br0">&#123;</span> text<span class="sy0">-</span>decoration<span class="sy0">:</span>underline<span class="sy0">;</span> <span class="br0">&#125;</span></pre></div></div></div>

<p>The order of the<strong> pseudo-class </strong>rules is important (and if you get the order wrong, you may experience some of the CSS rules displaying inconsistently across browsers). As a general rule, always put pseudo-classes in the following order:</p>
<blockquote><p><strong>link, visited, hover, focus, active</strong></p></blockquote>
<p>So, whenever you define a <strong>hover</strong> pseudo-class CSS rule, consider adding in a <strong>focus</strong> and then an <strong>active</strong> pseudo-class at the same time &#8211; it will help users that choose to use the keyboard to navigate your site.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codecouch.com/2009/01/use-css-pseudo-classes-to-enhance-accessibility/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Problems tabbing through checkboxes and radios in MacOSX Safari</title>
		<link>http://www.codecouch.com/2008/10/problems-tabbing-through-checkboxes-and-radios-in-macosx-safari/</link>
		<comments>http://www.codecouch.com/2008/10/problems-tabbing-through-checkboxes-and-radios-in-macosx-safari/#comments</comments>
		<pubDate>Tue, 21 Oct 2008 12:45:34 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[Browsers]]></category>
		<category><![CDATA[MacOSX]]></category>
		<category><![CDATA[Safari]]></category>

		<guid isPermaLink="false">http://www.codecouch.com/?p=199</guid>
		<description><![CDATA[Many people find it easier to use the tab key to cycle through the various fields of a form in a web page. If you are using a browser in MacOSX, you will find that you cannot use the tab key to access checkboxes or radio buttons... instead you have to use the mouse/trackpad. Read on for a solution.]]></description>
			<content:encoded><![CDATA[<p>Many people find it easier to use the tab key to cycle through the various fields of a form in a web page. This is a well supported and adopted behaviour &#8211; yet if you are using a browser in MacOSX, you will find that you cannot use the tab key to access checkboxes or radio buttons&#8230; instead you have to use the mouse/trackpad.</p>
<p>The solution is rather trivial &#8211; and also very simple to achieve.</p>
<p>Open the System Preferences application and choose Keyboard &#038; Mouse then change the Keyboard Shortcuts option to &#8220;All controls&#8221; (this can also be toggled using Control-Function-F7 if you are so inclined).</p>
<p>You can now use the tab key to cycle through checkboxes (use the spacebar to select a checkbox when you have cycled to it) and radio buttons (you can use up/down or left/right arrow keys to toggle a radio button when the group is in focus).</p>
<p>A similar option is available in Safari (MacOSX as well as Windows) in the Preferences menu option (within the Edit menu). Select the Advanced tab and select &#8220;Press Tab to highlight each item on a webpage&#8221;. When enabled, this option allows you to cycle through all elements that can receive focus using option+tab (this includes standard links on the page as well).</p>
<p>I&#8217;d like to credit this &#8220;discovery&#8221; to Brad Jasper and Dylan Ryan at <a href="http://www.mactips.org/archives/2008/04/30/tab-through-checkboxes-and-radio-buttons-in-safari/"> MacTips: Tips &#038; Tricks</a> &#8211; but the post is no longer available. Thanks for the heads-up guys!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codecouch.com/2008/10/problems-tabbing-through-checkboxes-and-radios-in-macosx-safari/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
