<?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; JavaScript</title>
	<atom:link href="http://www.nickfitz.co.uk/categories/web-development/web-standards/javascript/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>
	</channel>
</rss>

