<?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>Just a Coder &#187; DOM</title>
	<atom:link href="http://www.nickfitz.co.uk/categories/web-development/web-standards/dom/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.nickfitz.co.uk</link>
	<description>The occasional online observations of Nick Fitzsimons</description>
	<lastBuildDate>Sun, 08 Jan 2012 02:09:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
		<item>
		<title>Quirks or Strict: a Quick Way to Tell</title>
		<link>http://www.nickfitz.co.uk/2006/06/04/quirks-or-strict-a-quick-way-to-tell/</link>
		<comments>http://www.nickfitz.co.uk/2006/06/04/quirks-or-strict-a-quick-way-to-tell/#comments</comments>
		<pubDate>Sun, 04 Jun 2006 18:17:12 +0000</pubDate>
		<dc:creator>nickfitz</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[DOM]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Web Standards]]></category>

		<guid isPermaLink="false">http://www.nickfitz.co.uk/2006/04/30/quirks-or-strict-a-quick-way-to-tell/</guid>
		<description><![CDATA[A useful bit of JavaScript for web developers]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re working with <a href="http://www.w3.org/MarkUp/#recommendations">(X)HTML</a> and <a href="http://www.w3.org/Style/CSS/">CSS</a> you&#8217;ll be aware &#8211; or you <em>need</em> to be aware &#8211; that browsers render pages differently depending on whether they are in Strict or Quirks mode. (There are explanations of what these terms mean from <a href="http://msdn.microsoft.com/library/en-us/dnie60/html/cssenhancements.asp?frame=true#cssenhancements_topic2">Microsoft</a> and <a href="http://developer.mozilla.org/en/docs/Mozilla%27s_DOCTYPE_sniffing">Mozilla</a>.) It can be useful to have a way of making certain which mode you&#8217;re in when tracking down inconsistencies in browser behaviour.<br />
<span id="more-9"></span><br />
A quick and easy way to tell is to type the following snippet of JavaScript into the location bar:</p>
<p><code><a href="javascript:alert(document.compatMode);">javascript:alert(document.compatMode);</a></code></p>
<p>which will pop up a box stating either &#8220;BackCompat&#8221; for Quirks mode, or &#8220;CSS1Compat&#8221; for Strict mode.</p>
<p>If you&#8217;re using Firefox and have the Bookmarks toolbar visible, you can drag the following link on to it to create a handy little button you can use to check which rendering mode the browser is in on any page you visit. In Internet Explorer, right-click on the link and select &#8220;Add to Favorites&#8230;&#8221; to achieve the same thing. (You&#8217;ll get a warning that the link &#8220;may not be safe&#8221;; at that point you have to decide how much you trust me. Believe me, it&#8217;s safe.)<br />
<code><a href="javascript:alert(document.compatMode);">Rendering mode</a></code></p>
<p>I find this tremendously useful for doing checks on pages, particularly when editing pages by hand, where a simple typo might throw a page into Quirks mode, with resultant frustration as CSS which previously worked suddenly goes completely to pot.</p>
<p>(Note that the &#8220;CSS1Compat&#8221; actually means &#8220;CSS2Compat&#8221; in browsers with support for CSS 2.1.)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nickfitz.co.uk/2006/06/04/quirks-or-strict-a-quick-way-to-tell/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>JavaScript Get-Together, London 2005-06-11</title>
		<link>http://www.nickfitz.co.uk/2005/06/13/javascript-get-together-london-2005-06-11/</link>
		<comments>http://www.nickfitz.co.uk/2005/06/13/javascript-get-together-london-2005-06-11/#comments</comments>
		<pubDate>Mon, 13 Jun 2005 19:58:28 +0000</pubDate>
		<dc:creator>nickfitz</dc:creator>
				<category><![CDATA[DOM]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Web Standards]]></category>

		<guid isPermaLink="false">http://www.nickfitz.co.uk/?p=5</guid>
		<description><![CDATA[<p>It's official - JavaScript is no longer evil.</p>]]></description>
			<content:encoded><![CDATA[<p>I wasn&#8217;t able to make it to @media, but I did travel down to London for the <a href="http://www.quirksmode.org/blog/archives/2005/06/11_june_london.html">JavaScript get-together</a> in the Old Thameside Inn on Saturday afternoon. Peter K of <a href="http://www.quirksmode.org/">Quirksmode</a> had an agenda of three primary items which he anticipated eight or nine JavaScript geeks turning up to discuss; the actual figures were nearer the 30 mark, and a lot of the attendees were from the design community, so the first two parts of the meeting were instead devoted to the primary question that @media had brought up: how to get the message about the correct use of scripting out to the larger community who are already working with standards-based HTML/CSS techniques, and now want to get into the possibilities they&#8217;ve perceived through offerings like GMail and Google Maps.<br />
<span id="more-5"></span><br />
<a href="http://www.kryogenix.org/days/2005/06/12/javascriptMeetup">Stuart Langridge</a> and <a href="http://adactio.com/journal/display.php/20050612174941.xml">Jeremy Keith</a> have already written up summaries of what was decided, so I won&#8217;t bother repeating them, but will move on to the discussion about the original three questions.</p>
<p>By the time we got onto these topics we&#8217;d moved outside, and numbers had decreased considerably; perhaps as a result of this, decisions were made fairly quickly (if they were made at all). In short, the results were:</p>
<ol>
<li>Naming: We&#8217;ll call it <em>DOM Scripting</em>;</li>
<li>The dreaded <code>onload</code> problem: All the things you&#8217;d think would work don&#8217;t. However Mozilla has an undocumented DOMContentLoaded event (which is probably to be standardised), and <a href="http://dean.edwards.name">Dean Edwards</a> explained that it is possible to provide support for this using IE behaviors (.htc files). I&#8217;m planning to do some experimentation on this one to see what the best approach is when working with other browsers, although I&#8217;m probably just repeating <a href="http://dean.edwards.name/weblog/2005/02/order-of-events/">Dean&#8217;s work</a>.</li>
<li>We&#8217;d all drunk enough by then that the discussion of Design Patterns drifted off into speculation about the noise a bagpipe band would make marching off a cliff and other important topics, but I&#8217;ll probably carry on with my advocacy of object oriented tehniques (suitably adapted to JavaScript&#8217;s strengths and weaknesses) until others point out how utterly wrong I am.</li>
</ol>
<p>So to summarise, you should expect to see a <em>lot</em> of writing coming out from this point onwards designed to propagate the meme of DOM Scripting, which can be defined as the process of enhancing web pages by adding a behaviour layer which beefs things up using standards-based techniques, degrades gracefully when JavaScript support is absent, and doesn&#8217;t interfere with accessibility when it <em>isn&#8217;t</em> absent.</p>
<p>If you&#8217;re wondering what that last bit means, consider the revelation brought to us by <a href="http://www.boxofchocolates.ca/">Derek Featherstone</a>: screen readers may not support JavaScript, but the browsers they read from do. Some of the implications of this are covered by Derek in <a href="http://www.boxofchocolates.ca/archives/2005/06/12/javascript-and-accessibility">this follow-up</a> to his @media presentation, and I have no doubt it&#8217;s something we&#8217;ll hear a lot more discussion about in the future. It means we&#8217;ve got to forget about just testing with JavaScript turned off if we want to be accesible, and that means rethinking a lot of things.</p>
<p>Finally, thanks to everybody for making Saturday afternoon such an enjoyable and informative gathering. I hope to catch up with you all again; if not before, there&#8217;s always @media 2006.</p>
<p>P.S.: if you&#8217;re looking for more info about the presentations at @media, don&#8217;t miss <a href="http://www.isolani.co.uk/blog/">Isofarro&#8217;s excellent notes and transcripts</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nickfitz.co.uk/2005/06/13/javascript-get-together-london-2005-06-11/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Obscure Internet Explorer Bugs: #1 of&#8230; who knows?</title>
		<link>http://www.nickfitz.co.uk/2005/05/17/obscure-internet-explorer-bugs-1-of-who-knows/</link>
		<comments>http://www.nickfitz.co.uk/2005/05/17/obscure-internet-explorer-bugs-1-of-who-knows/#comments</comments>
		<pubDate>Tue, 17 May 2005 19:51:22 +0000</pubDate>
		<dc:creator>nickfitz</dc:creator>
				<category><![CDATA[Bugs]]></category>
		<category><![CDATA[DOM]]></category>
		<category><![CDATA[Internet Explorer]]></category>

		<guid isPermaLink="false">http://www.nickfitz.co.uk/?p=2</guid>
		<description><![CDATA[<p>
A very peculiar bug in Internet Explorer: ever seen a tagName begin with a <code>/</code> before?
</p>]]></description>
			<content:encoded><![CDATA[<p>The Web Standards Group presented <a href="http://webstandardsgroup.org/features/tommy-olsson.cfm">ten questions</a> to <a href="http://autisticcuckoo.net/">Tommy Olsson</a>, one of which addresses the thorny issue of the <code>abbr</code> and <code>acronym</code> elements in HTML.<br />
<span id="more-2"></span><br />
Tommy&#8217;s discussion of this was informative, and I was particularly entertained by his assertion that</p>
<blockquote><p>Netscape invented ABBR, while Microsoft invented ACRONYM, and both types meant the same thing. Then the W3C incorporated both in HTML 3, but with subtly different semantics. Microsoft&#8217;s meaning of ACRONYM was replaced by something different, which made the people at Microsoft so furious that to this day they still don&#8217;t support the ABBR element type!</p></blockquote>
<p>as I came across a manifestation of this (possibly imaginary) dislike for the <code>abbr</code> element in Internet Explorer quite recently.</p>
<p>Consider the following markup fragment:</p>
<p><code></p>
<p>An example of an abbreviation might be <abbr title="Limited Liability Company">Ltd.</abbr>, used in the UK to denote a private company with limited liability.</p>
<p></code></p>
<p>One would expect a browser which supports <a href="http://www.w3.org/TR/html401/">HTML 4</a> (which IE is claimed to have done since <a href="http://msdn.microsoft.com/workshop/essentials/versions/xplatform.asp">version 4</a>) to produce a DOM structure as follows:</p>
<ul>
<li>Element: <strong>p</strong>
<ul>
<li>Text: <em>An example of an abbreviation might be </em></li>
<li>Element: <strong>abbr</strong>
<ul>
<li>Text: <em>Ltd.</em></li>
</ul>
</li>
<li>Text: <em>, used in the UK to denote a private company with limited liability.</em></li>
</ul>
</li>
</ul>
<p>Whereas IE actually produces the following:</p>
<ul>
<li>Element: <strong>p</strong>
<ul>
<li>Text: <em>An example of an abbreviation might be </em></li>
<li>Element: <strong>abbr</strong></li>
<li>Text: <em>Ltd.</em></li>
<li>Element: <strong style="color: red">/abbr</strong></li>
<li>Text: <em>, used in the UK to denote a private company with limited liability.</em></li>
</ul>
</li>
</ul>
<p>Yes, that&#8217;s correct: the initial <code>abbr</code> is parsed into an element, the text within remains as a <code>childNode</code> of the paragraph, and an element with the name <code>/abbr</code> is created.</p>
<p>If you try to use the <code>createElement</code> method of the <code>document</code> to create such an element, you naturally get an exception. But internally, IE manages to create an element whose name begins with a slash.</p>
<p>I don&#8217;t have a PC at home, so I can&#8217;t check right now whether or not spurious markup like <code><goat>Hello</goat></code> produces the same result, but I&#8217;ll check at work tomorrow and report back.</p>
<p><em>Long-delayed update</em>: The <goat> example above does indeed produce the same results.</goat></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nickfitz.co.uk/2005/05/17/obscure-internet-explorer-bugs-1-of-who-knows/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

