<?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>Josh Highland &#187; javascript</title>
	<atom:link href="http://joshhighland.com/blog/category/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://joshhighland.com/blog</link>
	<description>the living internet</description>
	<lastBuildDate>Tue, 24 Aug 2010 16:02:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>JQuery 1.3 domination through deprecation</title>
		<link>http://joshhighland.com/blog/2009/02/19/jquery-13-domination-through-deprecation/</link>
		<comments>http://joshhighland.com/blog/2009/02/19/jquery-13-domination-through-deprecation/#comments</comments>
		<pubDate>Thu, 19 Feb 2009 20:24:19 +0000</pubDate>
		<dc:creator>Josh Highland</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[web 2.0]]></category>

		<guid isPermaLink="false">http://joshhighland.com/blog/?p=545</guid>
		<description><![CDATA[On a project I maintain, we recently rolled up to JQuery 1.3.1 from JQuery 1.2.6. Upon doing so, several things instantly broke. I started seeing errors on lines like this: if($('input[@name=username]').val() != "") I decided to check the JQuery 1.3 relase notes to see what had changed. The first bullet point answered my problem: The [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-546" title="jquery 1.3" src="http://joshhighland.com/blog/wp-content/uploads/2009/02/jquery13_logo.jpg" alt="jquery 1.3" width="317" height="85" /></p>
<p>On a project I maintain, we recently rolled up to JQuery 1.3.1 from JQuery 1.2.6. Upon doing so, several things instantly broke.</p>
<p>I started seeing errors on lines like this:</p>
<pre>if($('input[@name=username]').val() != "")</pre>
<p>I decided to check the <a href="http://docs.jquery.com/Release:jQuery_1.3#Changes">JQuery 1.3 relase notes</a> to see what had changed.</p>
<p>The first bullet point answered my problem:</p>
<blockquote><p>The &#8216;@&#8217; in [@attr] has been removed. Deprecated since 1.2 this old syntax no longer works. Simply remove the @ to upgrade.</p></blockquote>
<p>As it turns out, the @ style selector was depricated and wasn&#8217;t suggested for use when JQuery 1.2 was released, but it was still supported. At 1.3 the @ style selector was removed all together, and as a result broke our code!</p>
<p>Following the upgrade instruction I removed the @ symbol from the selectors, and the code started running again.</p>
<p>The result:</p>
<pre>if($('input[name=username]').val() != "")</pre>
<p>A simple and effective upgrade, and a reason to closely pay attention to release notes</p>
]]></content:encoded>
			<wfw:commentRss>http://joshhighland.com/blog/2009/02/19/jquery-13-domination-through-deprecation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Machine is Us/ing Us</title>
		<link>http://joshhighland.com/blog/2009/01/05/the-machine-is-using-us/</link>
		<comments>http://joshhighland.com/blog/2009/01/05/the-machine-is-using-us/#comments</comments>
		<pubDate>Mon, 05 Jan 2009 17:35:07 +0000</pubDate>
		<dc:creator>Josh Highland</dc:creator>
				<category><![CDATA[internet]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[web 2.0]]></category>

		<guid isPermaLink="false">http://joshhighland.com/blog/?p=487</guid>
		<description><![CDATA[I saw  this video on @KurtyD&#8217;s blog, http://daradics.com. He said that the video had a transformational effect on him. I&#8217;m going to have to agree.]]></description>
			<content:encoded><![CDATA[<p>I saw  this video on <a href="http://twitter.com/kurtyd">@KurtyD&#8217;s</a> blog, <a href="http://daradics.com">http://daradics.com</a>. He said that the video had a transformational effect on him. I&#8217;m going to have to agree.</p>
<p><a href="http://joshhighland.com/blog/2009/01/05/the-machine-is-using-us/"><em>Click here to view the embedded video.</em></a></p>
]]></content:encoded>
			<wfw:commentRss>http://joshhighland.com/blog/2009/01/05/the-machine-is-using-us/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>JSON + Coldfusion</title>
		<link>http://joshhighland.com/blog/2008/02/11/json-coldfusion/</link>
		<comments>http://joshhighland.com/blog/2008/02/11/json-coldfusion/#comments</comments>
		<pubDate>Mon, 11 Feb 2008 17:54:51 +0000</pubDate>
		<dc:creator>Josh Highland</dc:creator>
				<category><![CDATA[coldfusion]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://joshhighland.com/blog/2008/02/11/json-coldfusion/</guid>
		<description><![CDATA[Bill Garoutte, just made a great blog post about using JSON with Coldfusion, as a faster and more light weight alternative to using WDDX to serialize data. If you use Coldfusion at all, I highly suggest you read it, and download his code sample. http://garoutte.com/?p=21]]></description>
			<content:encoded><![CDATA[<p><img src='http://joshhighland.com/blog/wp-content/uploads/2008/02/coldfusion_logo.jpg' /></p>
<p><a href="http://garoutte.com/">Bill Garoutte</a>, just made a great blog post about using JSON with Coldfusion, as a faster and more light weight alternative to using WDDX to serialize data. If you use Coldfusion at all, I highly suggest you read it, and download his code sample.</p>
<p><a href="http://garoutte.com/?p=21">http://garoutte.com/?p=21</a></p>
]]></content:encoded>
			<wfw:commentRss>http://joshhighland.com/blog/2008/02/11/json-coldfusion/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The GmailThis! bookmarklet</title>
		<link>http://joshhighland.com/blog/2008/01/18/the-gmailthis-bookmarklet/</link>
		<comments>http://joshhighland.com/blog/2008/01/18/the-gmailthis-bookmarklet/#comments</comments>
		<pubDate>Fri, 18 Jan 2008 18:31:19 +0000</pubDate>
		<dc:creator>Josh Highland</dc:creator>
				<category><![CDATA[internet]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[web 2.0]]></category>

		<guid isPermaLink="false">http://joshhighland.com/blog/2008/01/18/the-gmailthis-bookmarklet/</guid>
		<description><![CDATA[I use GMail as my main email client. Often I&#8217;m at work and I see something online that I think is useful, and I want to remind myself of it. I have tried righting down URLS on scraps of paper in the past, but sending an email to myself works as a good reminder for [...]]]></description>
			<content:encoded><![CDATA[<p><img src='http://joshhighland.com/blog/wp-content/uploads/2008/01/gmailthis.gif' /></p>
<p>I use GMail as my main email client. Often I&#8217;m at work and I see something online that I think is useful, and I want to remind myself of it. I have tried righting down URLS on scraps of paper in the past, but sending an email to myself works as a good reminder for me. As a bonus, I can pick up my GMail form anywhere, <a href="http://joshhighland.com/blog/2007/12/07/iphone-gmail-imap-awesome/">including my iPhone</a>.</p>
<p>I&#8217;m a programmer, so I am lazy by nature. It&#8217;s kind of a pain to open a new browser, and navigate to GMail.com and then copy and paste the URL of the site, and text into GMail and then send it.</p>
<p>Enter the <a href="http://contrapants.org/blog/2005/07/gmailthis.html">GmailThis! bookmarklet</a> by Doug Ward. Bookmarklets are bits of javascript that you save as bookmarks in your browser. When you click that bookmark the javascript runs. Basically bookmarklets are little javascript plugins that work in almost any browser.</p>
<p>The GmailThis! bookmarklet will open up a new Gmail window in a little popup. The body will have the URL of the page you are currently on, and any text you happen to have highlighted at the moment. All you have to do is enter the recipients name.</p>
<p>You can get the GmailThis! bookmarklet from Doug Wards site, <a href="http://contrapants.org/blog/2005/07/gmailthis.html">http://contrapants.org/blog/2005/07/gmailthis.html</a></p>
<p>Doug also made a <a href="http://www.vimeo.com/610908/">cool video</a> showing how simple the bookmarklet is to use.</p>
<p>If you are a heavy GMail user like I am, this is a must have.</p>
]]></content:encoded>
			<wfw:commentRss>http://joshhighland.com/blog/2008/01/18/the-gmailthis-bookmarklet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IE DOM : WTF!</title>
		<link>http://joshhighland.com/blog/2006/10/03/ie-dom-wtf/</link>
		<comments>http://joshhighland.com/blog/2006/10/03/ie-dom-wtf/#comments</comments>
		<pubDate>Tue, 03 Oct 2006 09:42:19 +0000</pubDate>
		<dc:creator>Josh Highland</dc:creator>
				<category><![CDATA[internet]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[web 2.0]]></category>

		<guid isPermaLink="false">http://joshhighland.com/blog/2006/10/03/ie-dom-wtf/</guid>
		<description><![CDATA[I have been working on a help documentation system at work. There are roughly 50,000 HTML files to deal with (yes 50 thousand). The html files have a pretty decent structure, but they are by no means XHTML. I dont have access to a web development language like php, cfm, for asp or this project [...]]]></description>
			<content:encoded><![CDATA[<p>
I have been working on a help documentation system at work.<br />
There are roughly 50,000 HTML files to deal with (yes 50 thousand).<br />
The html files have a pretty decent structure, but they are by no means XHTML.
</p>
<p>
I dont have access to a web development language like php, cfm, for asp or this project to insert<br />
the site navigation, page headers and footers, So I decided to go with some sweet web 2.0 un obtrusive javascript.
</p>
<p>
to make life easier for myself, I had the authors of the help system insert a single line into the head of each HTML file.<br />
The line was a call to a javascript file. That javascript then used the DOM to insert all the appropriate CSS and other JS files I needed to make the pages look clean, and do what I needed them to do.
</p>
<p>
Things looked great in FireFox. Life was good until I loaded the site into Internet Explorer.<br />
My beautiful project looked like a pile of crap, no styles, no javascript, just a stupid javascript error.
</p>
<p>
IE isnt known for its script debugging (another reason to no use IE). It took me literally hours to track down the problem.
</p>
<p>
I was doing this for all the css files (4 of them)</p>
<pre>
	var tmpElm = document.createElement(&#34;style&#34;);
	tmpElm.setAttribute(&#34;type&#34;, &#34;text/css&#34;);
	tmpElm.appendChild(document.createTextNode(&#34;/some/directory/sweetness.css);&#34;));
	document.getElementsByTagName(&#39;head&#39;)[0].appendChild(tmpElm);
</pre>
</p>
<p>
Its clean, simple unobtrusive javascript.<br />
create a style element, add the right attribute to it, add value to the style tag, then append it to the page head.<br />
straight forward stuff.
</p>
<p>
Like I said, FireFix had no problem with it. After doing tons of test, i realized that IE didnt like me appending a style tag to the head!<br />
Then I found this:
</p>
<p>
IE won&#39;t allow document.createElement(&#39;style&#39;)<br />
If you try to add style declarations in the head of a document, IE borks at the name &#39;style&#39; &#8211; &#34;unexpected call to method or property access&#34;.<br />
<br />
<a href="http://www.quirksmode.org/bugreports/archives/2006/01/IE_wont_allow_documentcreateElementstyle.html" target="_blank">http://www.quirksmode.org/bugreports/archives/2006/01/IE_wont_allow_documentcreateElementstyle.html</a>
</p>
<p>
IE gets confused between the head element &lt;style&gt; and the object property .style!
</p>
<p>
So I spend all that time debugging my code, which was perfectly fine, because IE is retarded and doesnt know the difference between &lt;style&gt; and .style!<br />
WTF!
</p>
<p>
I removed all that sweet un obtrusive code and used this instead:</p>
<pre>
	document.write(&#34;&lt;style type=&#34;text/css&#34;&gt;@import url(/some/directory/sweetness.css&#34;);
</pre>
</p>
<p>
I hate using document.write() these days, but it works in both IE and FF now.<br />
My life sucks some times.</p>
]]></content:encoded>
			<wfw:commentRss>http://joshhighland.com/blog/2006/10/03/ie-dom-wtf/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
