<?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>MikePadgett.com &#187; web standards</title>
	<atom:link href="http://www.mikepadgett.com/tag/web-standards/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mikepadgett.com</link>
	<description>Articles, reviews, travel, design, literature and more written by Mike Padgett, an Information Designer in Brussels</description>
	<lastBuildDate>Thu, 02 Feb 2012 09:02:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Wrangling writers: information design and content policy</title>
		<link>http://www.mikepadgett.com/technology/information-design/wrangling-writers-information-architecture-and-content-policy/</link>
		<comments>http://www.mikepadgett.com/technology/information-design/wrangling-writers-information-architecture-and-content-policy/#comments</comments>
		<pubDate>Tue, 16 Feb 2010 20:22:21 +0000</pubDate>
		<dc:creator>Mike Padgett</dc:creator>
				<category><![CDATA[Information design]]></category>
		<category><![CDATA[content management]]></category>
		<category><![CDATA[information architecture]]></category>
		<category><![CDATA[web standards]]></category>

		<guid isPermaLink="false">http://www.mikepadgett.com/?p=788</guid>
		<description><![CDATA[Notes on important themes in the close relationship between information design and content writing and editing.]]></description>
			<content:encoded><![CDATA[<div class="imgleft"><img src="http://www.mikepadgett.com/wp-content/uploads/2010/02/spitzweg.jpg" alt="Carl Spitzweg's 'The Poor Poet' (1839) Photo: Mike Padgett" width="300" height="389" />
<p class="caption">Carl Spitzweg&#8217;s <em>The Poor Poet</em> (1839)</p>
</div>
<p>Writing copy for online consumption still seems to be something of a black art. Most web professionals know <em>what</em> works, but figuring out <em>how</em> to achieve it is quite a different matter.</p>
<p>This article brings together a few of the themes that I encounter in my activities around the relationship between information design and editorial policy.</p>
<h3>The shock of the new</h3>
<p>Often I encounter writers and editors more used to &#8216;traditional&#8217; communications, raised on a diet of press releases, white papers and speeches. Some may even express impatience with the business of writing online copy: normally this is just a mask for unfamiliarity.</p>
<p>Indeed it&#8217;s probably understandable that those who work with such copy will tend to focus almost exclusively on the message rather than the medium, particularly if their subject is highly specialised. If looks could kill, it&#8217;d be best not to mention the word &#8216;Twitter&#8217;.</p>
<p>Successful online delivery requires method, usually arrived at through trial and error and a healthy dose of self-restraint. Specifics are beyond the scope of this article but certain characteristics are essential:</p>
<ul>
<li>Brevity</li>
<li>Structure</li>
<li>Pattern</li>
</ul>
<h3>Writing styles and content management</h3>
<p>Therefore when authoring content for online consumption, there tends not to be much room left over for personal style. Sometimes writers and their expectations need to be managed.</p>
<p>Consider a situation I experienced recently: a changeover of editors on a website consisting of 20,000+ units of content. In newspaper journalism the content model is often so strict that editorial changes are barely noticeable but here in public sector policy and statistics, the effect of the swap was both immediate and profound.</p>

<a href="http://www.mikepadgett.com/wp-content/gallery/florida-keys/011.jpg" title="Ernest Hemingway's writing desk. Key West, Florida" class="thickbox" rel="singlepic719" >
	<img class="ngg-singlepic ngg-right" src="http://www.mikepadgett.com/wp-content/gallery/cache/719__320x_011.jpg" alt="011.jpg" title="011.jpg" />
</a>

<p>The outgoing editor had a fastidious attention to detail. He was concerned to substantiate all assertions very carefully and maintained a subtractive, minimal approach to copy. His replacement took a freer hand and preferred to discuss matters at length.</p>
<p>Both writers were drafting materials essentially on the same subjects, yet the texture of their respective outputs was markedly different: the former produced shorter items peppered with links and endnotes whilst the latter delivered lengthy paragraphs and fewer headings.</p>
<h3>Involvement in the content writing process</h3>
<p>When should the information architect take a hand? How involved should she be in the editorial process?</p>
<p>The answers to these questions depend on the environment. Some writers and editors will be interested in hearing about information architecture, others may be rather more buffeted by the tides of strong personality.</p>
<p>What seems clear to me is that some guidance is essential for those less familiar with the online domain, but any imposition of strict editorial rulesets will send out the wrong message and will probably be ignored. </p>
<p>Unclaustrophobic guidelines explained by common sense should be adopted more or less silently (not to say gratefully) by most writers and editors and negate the worst excesses of any <em>prima donna</em>. I outlined the seeds of this approach in <a href="/technology/information-design/testing-relevance-of-contributed-or-migrated-content/">an earlier article about testing content for relevance</a>: it should just be a matter of turning principles into friendly advice.</p>
<h3>Turning good habits into workflow</h3>
<p>Here&#8217;s a quick reminder of the information design process at its simplest:</p>
<p><code class="centeralign">Data --> Information --> Communication --> Knowledge</code></p>
<p>Acronyms and abbreviations might well be the bane of modern communications. Why? Well, only prior knowledge gives access to the information, which is a subversion of the above.</p>
<p>In a technocratic environment, content writers risk making too many assumptions about the prior knowledge of their readers. In an international environment meanwhile, <abbr title="l'Organisation du Traité de l'Atlantique Nord" lang="fr">OTAN</abbr>, <abbr title="Põhja-Atlandi Lepingu Organisatsioon" lang="et">PALO</abbr> and <abbr title="Észak-atlanti Szerződés Szervezete" lang="hu">EASS</abbr> can all mean the same as <abbr title="North Atlantic Treaty Organisation">NATO</abbr>.</p>
<p>Online content writers should be encouraged to develop good habits and apply them regularly, then editors will ensure they&#8217;re kept up. The proper explanation of acronyms and abbreviations is just one example among many others that collectively form a corpus of editorial best practice and produce highly-skilled online writers.</p>
<h3>Conclusion</h3>
<p>Information design shouldn&#8217;t stop at the launch of a content management project or limit itself to technical development.</p>
<p>There is also an important role to play in the creation of institutional best practice and it&#8217;s a role that requires considerable sensitivity and lots of teamwork.</p>
<p>Internally, migrating and modelling content is a major task that depends on collective knowledge and must be completed in a collaborative context. Externally, the needs of the end-user must be properly understood and reflected in the published content.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mikepadgett.com/technology/information-design/wrangling-writers-information-architecture-and-content-policy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IE7 only: float bug on elements with italic, background properties</title>
		<link>http://www.mikepadgett.com/technology/technical/ie7-only-float-bug-on-elements-with-italics-and-background-properties/</link>
		<comments>http://www.mikepadgett.com/technology/technical/ie7-only-float-bug-on-elements-with-italics-and-background-properties/#comments</comments>
		<pubDate>Mon, 13 Jul 2009 20:28:42 +0000</pubDate>
		<dc:creator>Mike Padgett</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[browser wars]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[web standards]]></category>

		<guid isPermaLink="false">http://www.mikepadgett.com/?p=1248</guid>
		<description><![CDATA[What do you get if you cross a float and an italic in Internet Explorer?]]></description>
			<content:encoded><![CDATA[<p>Setting <tt>font-style:italic</tt> in your CSS for elements in the vicinity of a floated element can actually trigger a float bug in Internet Explorer 7.</p>
<p>This is only a problem, so far as I can see,  when you&#8217;re using backgrounds on the unfloated element(s), because thr background image or colour will overrun your floated element.</p>
<p>Want to try it? The situation is as follows:</p>
<ol>
<li>Float an element containing either an image or text</li>
<li>Continue with unfloated elements so that under normal circumstances they wrap around the floated element</li>
<li>Give the wrapped text a background property, such as a background colour or image</li>
</ol>
<p>The code so far:</p>
<p><code>/* CSS */<br />
.floated {float: right;}<br />
p {background: #fc0;}<br />
...<br />
&lt;!-- HTML --&gt;<br />
&lt;div class="floated"&gt;&lt;img src="/images/tmp.jpg" /&gt;&lt;/div&gt;<br />
&lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit&lt;/p&gt;<br />
&lt;p&gt;Class aptent taciti sociosqu ad litora torquent per conubia nostra per inceptos himenaeos&lt;/p&gt;<br />
</code><br />
Up to this point everything&#8217;s normal:</p>
<div class="centeralign"><img src="http://www.mikepadgett.com/wp-content/uploads/2009/07/no-bug.gif" alt="No bug" /></div>
<p>So far so good. Now add <tt>font-style:italic;</tt> to the rule for <tt>p</tt>.</p>
<p>Here&#8217;s Firefox, with no surprises:</p>
<div class="centeralign"><img src="http://www.mikepadgett.com/wp-content/uploads/2009/07/ff-italic-bug.gif" alt="Firefox italic float: no bug" /></div>
<p>But here&#8217;s Internet Explorer 7:</p>
<div class="centeralign"><img src="http://www.mikepadgett.com/wp-content/uploads/2009/07/ie-italic-bug.gif" alt="IE italic float bug" /></div>
<p>The only (il)logical answer seems to be the addition of <tt>overflow: auto</tt> to the rule with the background.</p>
<p>I was clued in by a <a href="http://muffinresearch.co.uk/archives/2006/12/28/bug-ie7-absolutely-positioned-italics/">slightly different issue with the same fix</a> already discovered long ago. Just to remind you once more, <em>this is IE7 only</em>, folks!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mikepadgett.com/technology/technical/ie7-only-float-bug-on-elements-with-italics-and-background-properties/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Testing CSS for print media: we need a Print Preview for developers!</title>
		<link>http://www.mikepadgett.com/technology/technical/testing-css-print-media-we-need-a-print-preview-for-developers/</link>
		<comments>http://www.mikepadgett.com/technology/technical/testing-css-print-media-we-need-a-print-preview-for-developers/#comments</comments>
		<pubDate>Mon, 15 Jun 2009 19:15:42 +0000</pubDate>
		<dc:creator>Mike Padgett</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[browser wars]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[web standards]]></category>

		<guid isPermaLink="false">http://www.mikepadgett.com/?p=1190</guid>
		<description><![CDATA[How I wish there was an easier way to test CSS intended for the printed page.]]></description>
			<content:encoded><![CDATA[<div class="imgright"><img src="http://www.mikepadgett.com/wp-content/uploads/2009/06/press.gif" alt="Engraving of a printing press c. 1568" /></p>
<p class="caption">Source: <a title="Links to an external website" href="http://en.wikipedia.org/wiki/File:Printer_in_1568-ce.png">Wikimedia Commons</a></p>
</div>
<p>The virtues of <tt>@media print</tt> have been explained elsewhere, best of all by Eric Meyer in his seminal A List Apart article <a title="Links to an external website" href="http://www.alistapart.com/articles/goingtoprint/"><em>Going to Print</em></a>, whose original publish date (May 2002) makes me feel a bit old!</p>
<p>Yet one of the most annoying aspects of developing CSS for print is testing it.</p>
<p>Now I know that testing print CSS doesn&#8217;t take a huge slice of our lives, but it annoys the heck out of me. So if you&#8217;re a tolerant sort of person who&#8217;s happy to rub along with naff workflows, you might find this article and indeed the fact that there&#8217;s a whole article on the subject, just a bit finicky.</p>
<p>Thing is, I <em>hate</em> testing print CSS.</p>
<p>Sure, simple markup and layouts only need buffing to a shine to be ready for print, but an increase in complexity or a requirement for absolute fidelity in printed material can lead to ugly scenes round my way.</p>
<h3>Print CSS: browser testing !== <em>Print Preview</em> testing</h3>
<div class="imgleft"><img src="http://www.mikepadgett.com/wp-content/uploads/2009/06/print.jpg" alt="Print styles in Firefox and Internet Explorer" /></div>
<p>Developers tend temporarily to substitute their screen CSS for their print CSS, run it in the ordinary browser environment, <em>et voilà</em>. Rinse and repeat.</p>
<p>Yet the actual conversion to the printed page can sometimes lead to unexpected results, as can be seen in the image: different browsers, different <em>Print Preview</em> results &#8211; even though in the browser there was nothing obviously objectionable.</p>
<h3>Print Preview !== a tool for development</h3>
<p>Finding fiddly print CSS issues would be a lot easier if testing tweaks was a smoother process. Every change cycle equates to:</p>
<ol>
<li>Refresh the page</li>
<li>Invoke Print Preview</li>
<li>Review the change</li>
<li>Close Print Preview</li>
</ol>
<p>Testing print CSS as opposed screen CSS appends two additional steps 2 and 4 &#8211; invoke Print Preview (<tt>Alt + F + V</tt> in Windows for both IE and Firefox) and close Print Preview (correspondingly <tt>Alt + F4</tt>) . Those two simple steps make the business <em>very</em> laborious, <em>even</em> if you can remember those shortcuts.</p>
<h3>Slight workflow improvement: an IE-only trick</h3>
<p>A dirty little script <em>in IE only</em> takes care of the task of invoking Print Preview, which slightly shortens the workflow. Yes, it&#8217;s IE only, but given that it&#8217;s usually IE giving me print CSS grief, every little helps:</p>
<p><code>&lt;script type="text/javascript"&gt;<br />
function printpr()<br />
{<br />
var OLECMDID = 7;<br />
var PROMPT = 1;<br />
var WebBrowser = '&lt;OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"&gt;&lt;/OBJECT&gt;';<br />
document.body.insertAdjacentHTML('beforeEnd', WebBrowser);<br />
WebBrowser1.ExecWB(OLECMDID, PROMPT);<br />
WebBrowser1.outerHTML = "";<br />
}<br />
printpr();<br />
&lt;/script&gt;</code></p>
<p>This script automatically invokes IE&#8217;s Print Preview. Dump it just before the <tt>&lt;/body&gt;</tt> and save yourself a shortcut! You could also call <tt>printpr()</tt> from anywhere else, of course. And <a title="Links to an external website" href="http://www.jguru.com/faq/view.jsp?EID=490852">here&#8217;s the source of the original code snippet</a>, which also shows a few other unrelated options such as <tt>Save As</tt>.</p>
<h3>Why can&#8217;t we refresh the Print Preview?</h3>
<p>All of which finally begs the question, why can&#8217;t we simply refresh the Print Preview with an <tt>F5</tt> shortcut, just like we have in the browser itself?</p>
<p>Probably because I&#8217;m the only person in the world who gets genuinely annoyed by testing print CSS in Print Preview. More fool me, I guess.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mikepadgett.com/technology/technical/testing-css-print-media-we-need-a-print-preview-for-developers/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Progressive enhancement and Flash: no longer a pact with the Devil</title>
		<link>http://www.mikepadgett.com/technology/technical/progressive-enhancement-flash-no-longer-a-pact-with-the-devil/</link>
		<comments>http://www.mikepadgett.com/technology/technical/progressive-enhancement-flash-no-longer-a-pact-with-the-devil/#comments</comments>
		<pubDate>Tue, 17 Feb 2009 17:07:39 +0000</pubDate>
		<dc:creator>Mike Padgett</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[web 2.0]]></category>
		<category><![CDATA[web standards]]></category>

		<guid isPermaLink="false">http://www.mikepadgett.com/?p=757</guid>
		<description><![CDATA[Using xHTML as an accessible data source for Flash objects just got a bit easier thanks to Faust.]]></description>
			<content:encoded><![CDATA[<div class="imgright"><img src="http://www.mikepadgett.com/wp-content/uploads/2009/02/flash.gif" alt="Flash" /></div>
<p>For me, Flash development pretty much dropped off the radar in 2004. <a title="Links to an external website" href="http://www.useit.com/alertbox/20001029.html">Jakob Nielsen famously killed the idea</a> of Flash as the be-all and end-all of websites and suddenly, like the stock market interest in the dotcoms, the buzz had gone.</p>
<p>I wrote about Flash again in 2006 on the occasion of the <a href="http://www.mikepadgett.com/technology/flash-is-10/">technology&#8217;s tenth birthday</a>, noting at the time that it was thanks to Flash that the online video boom had happened.</p>
<h3>Flash design 1.0</h3>
<p>Why did everyone stop doing Flash sites?</p>
<ol>
<li>Good design goes to heaven, it is often said, and bad design goes everywhere. Accessibility and usability suffered while the keyframes fizzed by. If you allowed your website to become a puzzle, as Nielsen concluded, users would just go elsewhere.</li>
<li>The Internet has always been a fickle sort of business, particularly once the marketers got into it. Flash as a key differentiator eventually and inevitably reached saturation point. There was no longer a wow factor to be had in whizzing keyframes: like the bodykitted <a title="Links to an external website" href="http://en.wikipedia.org/wiki/Vauxhall_Nova#Opel_Corsa_A">Vauxhall Nova</a>, every idiot had one.</li>
<li>The future of the Internet was predicated on &#8216;social&#8217; (and therefore interactive), user-generated content and relationships yet 99.9% of Flash sites were 99.9% read-only.</li>
<li>Javascript libraries reignited, then accelerated, the capabilities of the &#8216;traditional&#8217; XHTML-CSS interface.</li>
</ol>
<h3>A place in the sun</h3>
<p>The environment in which Flash finds itself today is rather different. Accessibility, usability and web standards are essential factors. Browsers are generally much improved. Business efficiency and profitability are paramount.</p>
<p>And within that environment Flash still has a place that, when implemented correctly, continues to be unchallenged in terms of relevance and effectiveness. It&#8217;s the format of choice for online video and music delivery, it&#8217;s still interoperable with excellent XML support and it continues to gain traction in the ever-growing mobile market.</p>
<h3>Progressive enhancement and visualisations</h3>
<p>Though much maligned as a user experience killer in the bad old days, most developers recognise the benefits of Flash <em>in small doses</em>. Flash was and is incredibly useful for visualisations. The last time I used it heavily, for example, was in the development of a floorplanning tool. I use it more often, however, for graphing numbers and geographical mapping (though GoogleMaps has increasing advantages).</p>
<p>When the metaphor is necessarily visual and the data is dynamic, there isn&#8217;t much out there that can match Flash for quick, effective results.</p>
<p>Now with &#8216;modern&#8217; methods, we can also provide an accessible experience. Any HTML table of data, or an ordered list of countries and their attributes, is a candidate for visualisation and pre-formatted data source. The original data will still be there on the page but a bit of simple DOM work can convert it into something Flash can use.</p>
<h3>Faust and the DOM</h3>
<div class="imgright"><img src="http://www.mikepadgett.com/wp-content/uploads/2009/02/ie-jquery-strange.jpg" alt="Crap Internet Explorer strikes again" width="300" height="202" /></div>
<p>As with many of these &#8216;development trends&#8217;, we&#8217;ve been doing it for years but some smart folks had to put a name to it. In this case, it&#8217;s the agency <a title="Links to an external website" href="http://www.space150.com">Space150</a> and they&#8217;ve named it after <a title="Links to an external website" href="http://www.space150.com/news/faust-flash-augmenting-standards">everyone&#8217;s favourite devil-dealer Faust</a>.</p>
<p>The idea is to provide content <em>on the page</em> and have Flash use that content via its support for XML. The visualisation is displayed and, typically though not always, the original content is hidden by recourse to Javascript.</p>
<p>So it follows that the content exists without Flash requesting it, which means that it&#8217;s accessible and search-engine friendly.</p>
<p>What&#8217;s interesting though, is how the developers got around DOM limitations caused by Internet Explorer&#8217;s serialisation of HTML rather than XML. Consider the following example:</p>
<p><code>&lt;ol id="countries"&gt;<br />
&lt;li id="cty-1"&gt;&lt;a href="#"&gt;Algeria&lt;/a&gt;&lt;/li&gt;<br />
&lt;li id="cty-2"&gt;&lt;a href="#"&gt;Argentina&lt;/a&gt;&lt;/li&gt;<br />
&lt;li id="cty-3"&gt;&lt;a href="#"&gt;Australia&lt;/a&gt;&lt;/li&gt;<br />
&lt;li id="cty-4"&gt;&lt;a href="#"&gt;Belarus&lt;/a&gt;&lt;/li&gt;<br />
&lt;li id="cty-5"&gt;&lt;a href="#"&gt;Brazil&lt;/a&gt;&lt;/li&gt;<br />
&lt;li id="cty-6"&gt;&lt;a href="#"&gt;Canada&lt;/a&gt;&lt;/li&gt;<br />
&lt;li id="cty-7"&gt;&lt;a href="#"&gt;Chile&lt;/a&gt;&lt;/li&gt;<br />
&lt;/ol&gt;<br />
</code></p>
<p>In Javascript, we ask:</p>
<p><code>alert(document.getElementById('countries').innerHTML);</code></p>
<p>or with JQuery if you prefer:</p>
<p><code>alert($('#countries').html());</code></p>
<p>Here&#8217;s the DOM excerpt from Firefox:</p>
<p class="centeralign"><img src="http://www.mikepadgett.com/wp-content/uploads/2009/02/ff-jquery-html.gif" alt="Firefox DOM excerpt" width="326" height="196" /></p>
<p>Now note the equivalent excerpt from Internet Explorer:</p>
<p class="centeralign"><img src="http://www.mikepadgett.com/wp-content/uploads/2009/02/ie-dom-html.gif" alt="Internet Explorer DOM excerpt" width="296" height="185" /></p>
<p>See how the nodes get capitalised and the @id is stripped of quotes? This isn&#8217;t &#8220;illegal&#8221; behaviour, but it <em>is</em> exceptionally irritating. Passing that IE excerpt as a string to Flash via flashvars is a recipe for trouble.</p>
<p>The developers &#8220;sanitise&#8221; this DOM output by converting it to XHTML (and therefore well-formed XML) using a (relatively) simple function contained in their innerxhtml.js:</p>
<pre><code>// innerXHTML
// -------------------------------------------------------
// Copyright (c) 2006 space150, LLC and released under the CPL license:
// http://opensource.org/licenses/cpl1.0.php
// -------------------------------------------------------
function innerXHTML(obj, encode) {
   // It is an option to pass innerXHTML() a string indicating an id attribute
   if (typeof obj == "string") {
      obj = document.getElementById(obj)
   }
   var open = '';
   var content = '';
   var close = '';
   var tagname = obj.nodeName.toLowerCase();
   var emptytag = (obj.nodeName.match(/area|base|basefont|br|col|frame|hr|img|input|
      isindex|link|meta|param/i)) ? true : false;

   // Write open tag
   open = '&lt;'+tagname;

   for (var i=0; i&lt;obj.attributes.length; i++) {
      if (obj.attributes[i].specified &amp;&amp; obj.attributes[i].value != "null") {
         open += ' '+obj.attributes[i].name.toLowerCase()+'="'
            +obj.attributes[i].value+'"';
      }
   } open += (emptytag) ? ' /&gt;' : '&gt;';

   if (!emptytag) {
      // Write tag content
      for (var i=0; i&lt;obj.childNodes.length; i++) {
         var node = obj.childNodes[i];
         if (node.nodeType==3) {
            content += node.data;
         else if (node.nodeType==1) {
            content += innerXHTML(obj.childNodes[i], false);
         else {
            content += " ";
         }
      } // Write closing tag
    close = '&lt;/'+tagname+'&gt;';
    }
    // URI encode the content if desired
    return (typeof(encode)=="undefined" || encode==true) ? encodeURIComponent(open+
      content+close) : open+content+close;
}</code></pre>
<p>Et voilà! Beautifully done.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mikepadgett.com/technology/technical/progressive-enhancement-flash-no-longer-a-pact-with-the-devil/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>jQuery .html() returns strange results in IE after other bindings</title>
		<link>http://www.mikepadgett.com/technology/technical/jquery-html-strange-results-ie-events/</link>
		<comments>http://www.mikepadgett.com/technology/technical/jquery-html-strange-results-ie-events/#comments</comments>
		<pubDate>Tue, 17 Feb 2009 13:40:56 +0000</pubDate>
		<dc:creator>Mike Padgett</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[internet explorer]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[web 2.0]]></category>
		<category><![CDATA[web standards]]></category>

		<guid isPermaLink="false">http://www.mikepadgett.com/?p=746</guid>
		<description><![CDATA[Sometimes we're stuck with junk attributes in jQuery.html() for Internet Explorer.]]></description>
			<content:encoded><![CDATA[<p class="note">This article originally addressed jQuery 1.3.1. See below for results in jQuery 1.4 (18 January 2010)</p>
<div class="imgright"><img title="Internet Explorer: where it belongs?" src="http://www.mikepadgett.com/wp-content/uploads/2009/02/ie-jquery-strange.jpg" alt="Internet Explorer: where it belongs?" width="300" height="202" /></div>
<p>When I&#8217;m testing work done with jQuery in Internet Explorer, I&#8217;m normally a karmic cow. I wonder if <a title="Links to an external website" href="http://ejohn.org/">Mr Resig</a> and friends ever thought about their specific contribution to world peace.</p>
<p>Indeed with jQuery, you can almost forget about the bad old days. At least until something comes along like it did this morning, when I hit a situation using <tt>.html()</tt>.</p>
<h3>Using <tt>.html()</tt> to return elements with bound events</h3>
<p>If we use jQuery to bind events to an element and then take a look at the DOM, Internet Explorer may well return unexpected results. Here&#8217;s the code:</p>
<p><code>&lt;script type="text/javascript" src="jquery.js"&gt;&lt;/script&gt;<br />
&lt;script type="text/javascript"&gt;<br />
//&lt;![CDATA[<br />
$(document).ready(function(){<br />
$('#countries li a').click(function(){alert('clicked!');})<br />
alert($('#countries').html());<br />
});<br />
//]]&gt;<br />
&lt;/script&gt;<br />
...<br />
&lt;ol id="countries"&gt;<br />
&lt;li id="cty-1"&gt;&lt;a href="#"&gt;Algeria&lt;/a&gt;&lt;/li&gt;<br />
&lt;li id="cty-2"&gt;&lt;a href="#"&gt;Argentina&lt;/a&gt;&lt;/li&gt;<br />
&lt;li id="cty-3"&gt;&lt;a href="#"&gt;Australia&lt;/a&gt;&lt;/li&gt;<br />
&lt;li id="cty-4"&gt;&lt;a href="#"&gt;Belarus&lt;/a&gt;&lt;/li&gt;<br />
&lt;li id="cty-5"&gt;&lt;a href="#"&gt;Brazil&lt;/a&gt;&lt;/li&gt;<br />
&lt;li id="cty-6"&gt;&lt;a href="#"&gt;Canada&lt;/a&gt;&lt;/li&gt;<br />
&lt;li id="cty-7"&gt;&lt;a href="#"&gt;Chile&lt;/a&gt;&lt;/li&gt;<br />
&lt;/ol&gt;<br />
</code></p>
<p>Consider the result from Firefox below. Predictable isn&#8217;t it?</p>
<p class="centeralign"><img src="http://www.mikepadgett.com/wp-content/uploads/2009/02/ff-jquery-html.gif" alt="Well-formed results in Firefox" width="326" height="196" /></p>
<p>Now look at Internet Explorer 7 and notice the junk that&#8217;s found its way in there:</p>
<p class="centeralign"><img src="http://www.mikepadgett.com/wp-content/uploads/2009/02/ie-jquery-html.gif" alt="Unexpected results in Internet Explorer" width="488" height="185" /></p>
<div class="centeralign note"><img src="http://www.mikepadgett.com/wp-content/uploads/2009/02/ie-jquery-14.gif" alt="Results in jQuery 1.4" width="477" height="224" />
<p class="centeralign">Results for IE7 + jQuery 1.4</p>
</div>
<p>It&#8217;s like Sizzle just ate a bag of shell-on peanuts in your taxicab. The behaviour has been <a title="Links to an external website" href="http://v3.thewatchmakerproject.com/journal/464/odd-jquery-gotcha-ie-and-html">described briefly by Matthew Pennell</a>.</p>
<p>It&#8217;s only a problem if for some reason you need clean, well-formed XHTML.</p>
<h3>Don&#8217;t depend on <tt>.html()</tt> for well-formed XML snippets</h3>
<p>For example if &#8211; like me &#8211; you were using XHTML from the page as a dataset for use in a dynamic Flash object (via <a href="/technology/technical/progressive-enhancement-flash-no-longer-a-pact-with-the-devil/">progressive enhancement</a>) then that could be a problem: Flash balks at this stuff in IE.</p>
<h3>Moral of the story: check your code</h3>
<p>My quick fix was to change the order of business. I simply did my jQuery event binding <em>after</em> the data had been sent. A hard lesson learned, then, in view of the amount of time I spent tearing my hair out, but an important one nonetheless.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mikepadgett.com/technology/technical/jquery-html-strange-results-ie-events/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Web Standards</title>
		<link>http://www.mikepadgett.com/technology/technical/web-standards/</link>
		<comments>http://www.mikepadgett.com/technology/technical/web-standards/#comments</comments>
		<pubDate>Mon, 17 Oct 2005 12:31:22 +0000</pubDate>
		<dc:creator>Mike Padgett</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[browser wars]]></category>
		<category><![CDATA[content management]]></category>
		<category><![CDATA[web standards]]></category>
		<category><![CDATA[zeldman]]></category>

		<guid isPermaLink="false">http://localhost/?p=190</guid>
		<description><![CDATA[What progression we have in the field of web development is thanks in no small part to Jeffrey Zeldman.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m currently two-thirds through <a href="http://www.zeldman.com">Jeffrey Zeldman</a>&#8216;s &#8220;Designing with Web Standards&#8221;.</p>
<p>It was published only a couple of years ago (a long time in Web world, of course) and it&#8217;s interesting to trace the arc of developments since then.</p>
<p class="centeralign"><img src="/legacy/images/client_images/zeldman.gif" alt="Zeldman.com - home of web designer and standards evanglelist Jeffrey Zeldman" height="243" width="350" /></p>
<p>Whilst much of the methodology described in the book is becoming increasingly normal nowadays, I certainly wasn&#8217;t aware of the scale of Zeldman&#8217;s achievements with regard to ending the so-called <a href="http://en.wikipedia.org/wiki/Browser_wars">Browser Wars</a> with the <a href="http://www.webstandards.org">Web Standards Project</a> until now.</p>
<p>Web standards implementation as a strategy has exploded into the forefront of my job, so it is now important to put together a strong business case in order to get buy-in from developers and management. It is no longer enough, it seems, to encourage topical best practice from colleagues.</p>
<p>For many people I&#8217;m dealing with, the understanding of (X)HTML standards seems to be quite practical &#8211; &#8220;table avoidance&#8221; is one of the most visible concerns and, as Zeldman also points out, the problem of automatically generated code from content management applications.</p>
<p>Time will tell how far I can take it, especially for internal systems, but it looks set to be a pretty lonely path for now!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mikepadgett.com/technology/technical/web-standards/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

