<?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>Seth Kinast's Blog &#187; jQuery</title>
	<atom:link href="http://sethkinast.com/tag/jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://sethkinast.com</link>
	<description>I like shiny things</description>
	<lastBuildDate>Thu, 28 Jul 2011 05:12:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>jQuery &amp; application/xhtml+xml</title>
		<link>http://sethkinast.com/2008/01/22/jquery-applicationxhtmlxml/</link>
		<comments>http://sethkinast.com/2008/01/22/jquery-applicationxhtmlxml/#comments</comments>
		<pubDate>Tue, 22 Jan 2008 23:01:48 +0000</pubDate>
		<dc:creator>Seth</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[application/xhtml+xml]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://sethkinast.com/2008/01/22/jquery-applicationxhtmlxml/</guid>
		<description><![CDATA[For reasons previously discussed, serving your site up as application/xhtml+xml is a good thing to do. Check that post for all the reasons why. So now, you&#8217;ve taken the plunge and swapped your content-types. Whoa! Why did everything on your site just break? The first reason, of course, is invalid HTML. If you&#8217;re getting the [...]]]></description>
			<content:encoded><![CDATA[<p>For <a href="/2005/03/01/applicationxhtmlxml/">reasons previously discussed</a>, serving your site up as <code>application/xhtml+xml</code> is a good thing to do. Check that post for all the reasons why.</p>
<p>So now, you&#8217;ve taken the plunge and swapped your content-types. Whoa! Why did everything on your site just break? The first reason, of course, is invalid HTML. If you&#8217;re getting the <a href="http://www.answers.com/Yellow%20Screen%20of%20Death">Yellow Screen of Death</a> in Firefox, just fix what it asks and you&#8217;ll be back on track. However, if your <em>JavaScript</em> suddenly bites it, chances are that you were using methods that are deprecated and no longer supported. You see, when traversing an XML DOM, everything must be viewed in terms of elements. You can&#8217;t munge or alter the raw code, because you might generate invalid markup. Instead, you must insert, delete, or change existing elements.</p>
<p>&#8220;But but!&#8221; you cry. &#8220;I used the latest version of jQuery, just like you taught me! And I didn&#8217;t use anything but jQuery methods!&#8221; Well that&#8217;s great, but even jQuery can only do so much. Some of its methods rely on the unsupported <code>innerHTML</code>. So here&#8217;s how you fix the issues. Hey, it could be worse; you could have been using <code>document.write</code>!</p>
<h3>html() &#038; html(val)</h3>
<p><a href="http://docs.jquery.com/Attributes/html">These methods rely on <code>innerHTML</code>.</a> Consider using <code>text()</code> instead to only replace the text inside elements. If you were using <code>html()</code> to copy an element&#8217;s contents, try <code>clone()</code>. Finally, if you used <code>html()</code> because you really wanted all the elements inside, use <code>children()</code>. The key is to think of an element&#8217;s contents as nodes along the DOM tree, rather than a bunch of tag soup. Is there an <code>&lt;img /&gt;</code> inside your element? Don&#8217;t try to copy the HTML somewhere else. Just think, &#8220;Hey, I have an image element there. I can query for its src value, which is the important part. Then, I can recreate that image anywhere I want.&#8221; Elements are always replaceable&#8211; you need only give them back their attributes.</p>
<h3>$(&#8220;html here&#8221;)</h3>
<p>This is a slightly lesser-used aspect of jQuery. It&#8217;s used to <a href="http://docs.jquery.com/Core/jQuery#html">inject raw HTML into the DOM</a>. See a problem? Yep, XHTML+XML doesn&#8217;t do raw HTML. Everything is elements! Fortunately, it&#8217;s easy to fix this in your code. Instead of <code>$("&lt;img src='muu.png' /&gt;")</code>, try using <code>$(document.createElement("img")).attr("src","muu.png");</code> Not too hard, right?</p>
]]></content:encoded>
			<wfw:commentRss>http://sethkinast.com/2008/01/22/jquery-applicationxhtmlxml/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Fun with scripts</title>
		<link>http://sethkinast.com/2008/01/11/fun-with-scripts/</link>
		<comments>http://sethkinast.com/2008/01/11/fun-with-scripts/#comments</comments>
		<pubDate>Sat, 12 Jan 2008 05:41:05 +0000</pubDate>
		<dc:creator>Seth</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Gravatar]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[OpenID]]></category>
		<category><![CDATA[Website]]></category>

		<guid isPermaLink="false">http://sethkinast.com/2008/01/11/fun-with-scripts/</guid>
		<description><![CDATA[Mmm, I&#8217;m making more use of dynamic scripts on the new blog than ever before. Not only am I using jQuery, thanks to all I learned about it while writing ZB&#8217;s scripts, but I even rewrote some of my old scripts like my Headline Image Replacement with jQuery. In HIR&#8217;s case, the script went from [...]]]></description>
			<content:encoded><![CDATA[<p>Mmm, I&#8217;m making more use of dynamic scripts on the new blog than ever before. Not only am I using <a href="http://jquery.com/">jQuery</a>, thanks to all I learned about it while writing ZB&#8217;s scripts, but I even rewrote some of my old scripts like my Headline Image Replacement with jQuery. In HIR&#8217;s case, the script went from 8 kilobytes to about 400 bytes. Yay jQuery! In addition, I serve a pre-compressed version of jQuery to browsers that can handle it (not IE), which makes jQuery + all my scripts + new scripts <strong>smaller</strong> than the old stuff!</p>
<p>There are four main scripts that I&#8217;m using to make things nice. My Where&#8217;s Seth script is back, but now instead of just pulling from my Google Calendar, it also works off Jabber away messages that my Trillian client sends. I need to make it more robust, so we&#8217;ll see what other ways I can pull information, such as <a href="http://twitter.com/">Twitter</a> feeds. For my linkblog, I rolled a little bit of jQuery to fetch JSON data from <a href="http://ma.gnolia.com/">Ma.gnolia</a> (which is like <a href="http://del.icio.us">del.icio.us</a> but nicer), so I don&#8217;t have to maintain links in two separate places.</p>
<p>On the WordPress plugins side, I&#8217;ve added <a href="http://openid.net/">OpenID</a> and Gravatar support. <a href="http://wordpress.org/extend/plugins/openid/">WP-OpenID</a> allows commenters to use their OpenID, both to verify their identity and to obviate having to type all that commenter info every time. <a href="http://gravatar.com/">Gravatar</a> was acquired by WordPress, which makes me finally comfortable enough to use it on a blog. Before, it was just too unstable&#8211; the service was unavailable all the time and I didn&#8217;t feel like it was &#8220;official&#8221; enough to make it widespread and worth using. With official adoption by WordPress, it should become more of a de facto standard, one that I feel comfortable supporting.</p>
<p>Javascript is fun :O</p>
]]></content:encoded>
			<wfw:commentRss>http://sethkinast.com/2008/01/11/fun-with-scripts/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

