<?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>Trev's Travels &#187; Programming</title>
	<atom:link href="http://trevorcreech.com/blog/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://trevorcreech.com</link>
	<description></description>
	<lastBuildDate>Tue, 01 Dec 2009 20:14:13 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Firefox 3.5 not collapsing spaces in JavaScript className</title>
		<link>http://trevorcreech.com/blog/2009/07/17/firefox-3-5-not-collapsing-spaces-in-javascript-classname/</link>
		<comments>http://trevorcreech.com/blog/2009/07/17/firefox-3-5-not-collapsing-spaces-in-javascript-classname/#comments</comments>
		<pubDate>Sat, 18 Jul 2009 04:57:04 +0000</pubDate>
		<dc:creator>Trevor</dc:creator>
				<category><![CDATA[Geekery]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://trevorcreech.com/?p=634</guid>
		<description><![CDATA[In JavaScript, to get all the classes on a given element, you call element.className, which gives a string with space-separated classes, such as &#8220;class1 class2”.  You can also set this property directly, such as element.className = "class3 class4”.  The norm here is that classes are separated by a single space, with no whitespace [...]]]></description>
			<content:encoded><![CDATA[<p>In JavaScript, to get all the classes on a given element, you call element.<a href="https://developer.mozilla.org/en/DOM:element.className">className</a>, which gives a string with space-separated classes, such as &#8220;class1 class2”.  You can also set this property directly, such as <code>element.className = "class3 class4”</code>.  The norm here is that classes are separated by a single space, with no whitespace at either end, but since we are just setting a string directly, we can send in any whitespace we want.  This is where things get interesting, because in Firefox 3.0, any unnecessary whitespace is removed, leaving the string the way you would expect it to be formatted.  However, in the newly released Firefox 3.5, this does not happen, and the extraneous whitespace remains.  Here&#8217;s a live example.  Clicking this link sets its own className to <code>"     class1     class2     "</code>, and then displays its newly set className:</p>
<p><a onclick="this.className=&quot;     class1     class2     &quot;;alert(&quot;\&quot;&quot; + this.className + &quot;\&quot;&quot;);" href="#">Try me!</a><br />
In Firefox 3.0 you will see <code>"class1 class2”</code>, but Firefox 3.5 will show <code>"     class     class2     "</code>.</p>
<p>I&#8217;m not sure if this is a bug or a feature, but it&#8217;s a bit of a gotcha if you are at all sloppy in setting classes, as it might mess up a class-recognizing regex later on, which exactly what happened at work today, in our <a href="http://gr.postrank.com">Google Reader extension</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://trevorcreech.com/blog/2009/07/17/firefox-3-5-not-collapsing-spaces-in-javascript-classname/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Testing of Subscription Service</title>
		<link>http://trevorcreech.com/blog/2005/12/28/testing-of-subscription-service/</link>
		<comments>http://trevorcreech.com/blog/2005/12/28/testing-of-subscription-service/#comments</comments>
		<pubDate>Wed, 28 Dec 2005 16:35:44 +0000</pubDate>
		<dc:creator>Trevor</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Website]]></category>

		<guid isPermaLink="false">http://blog.trevorcreech.com/?p=400</guid>
		<description><![CDATA[If you have recieved this post by email, you have been successfully subscribed to my email updates, and I&#8217;ve written my first successful php program  
]]></description>
			<content:encoded><![CDATA[<p>If you have recieved this post by email, you have been successfully subscribed to my email updates, and I&#8217;ve written my first successful php program <img src='http://trevorcreech.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://trevorcreech.com/blog/2005/12/28/testing-of-subscription-service/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
