<?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>Code Nomad &#187; firebug</title>
	<atom:link href="http://jasonkarns.com/blog/category/firebug/feed/" rel="self" type="application/rss+xml" />
	<link>http://jasonkarns.com/blog</link>
	<description>Tales of a Transient Programmer</description>
	<lastBuildDate>Thu, 19 Apr 2012 21:57:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>jQuery.Firebug: A call for feedback.</title>
		<link>http://jasonkarns.com/blog/jqueryfirebug-a-call-for-feedback/</link>
		<comments>http://jasonkarns.com/blog/jqueryfirebug-a-call-for-feedback/#comments</comments>
		<pubDate>Wed, 11 Feb 2009 20:17:49 +0000</pubDate>
		<dc:creator>jasonkarns</dc:creator>
				<category><![CDATA[firebug]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[debugging]]></category>

		<guid isPermaLink="false">http://jasonkarns.com/blog/?p=33</guid>
		<description><![CDATA[As a result of some of the discussion following from my post on my new jQuery plugin, jQuery.Firebug I&#8217;m soliciting feedback for its desired behavior. Example: $('.setA').log(); $('.setB').log("some", "information"); $('.setC').log("title attribute is: ", ".attr('title')"); Some explanation. The log method follows the same rules as the Firebug console.log method. It can take 0 or more arguments [...]]]></description>
			<content:encoded><![CDATA[<p>As a result of some of the discussion following from my post on my new jQuery plugin, <a href="http://jasonkarns.com/blog/2009/01/06/announcing-jqueryfirebug/">jQuery.Firebug</a> I&#8217;m soliciting feedback for its desired behavior. Example:</p>
<pre class="javascript">
$('.setA').log();
$('.setB').log("some", "information");
$('.setC').log("title attribute is: ", ".attr('title')");
</pre>
<p>Some explanation. The log method follows the same rules as the <a href="http://getfirebug.com/console.html">Firebug console.log</a> method. It can take 0 or more arguments that are concatenated into a space-separated string when finally printed to the console. For some jQuery-specific behavior, I have added a little wrinkle as shown with the log statement following SetC. If an argument to the log method:</p>
<ol>
<li>is a string</li>
<li>begins with a period (dot)</li>
<li>is a valid jQuery method</li>
</ol>
<p>then the jQuery method specified is executed on the jQuery selection and the <em>result</em> is printed to the console. In the example above, if the title attribute on the first element of <var>SetC</var> is <code>'example title'</code> then the final log message would be <code>"title attribute is: example title"</code>.</p>
<p>Further, my the plugin will feature an additional option (off by default) that will explicitly print each element in the jQuery selection wrapped in a <code>console.group</code>. In the example above, say <var>SetC</var> contains 2 <code>&lt;span&gt;</code> elements. If the option were turned on, the output would be similar to the output of the following:</p>
<pre class="javascript">
console.log("title attribute is: example title");
console.group($(".setC"));
console.log($(".setC").get(0));
console.log($(".setC").get(1));
console.groupEnd();
</pre>
<p>So, back to the problem at hand. My issue, is when and where to print the jQuery selection itself. The different options are:</p>
<ol>
<li>only print the jQuery selection when there are no arguments to the log method</li>
<li>only print the jQuery selection when there are no arguments to the log method but also print the jQuery selection in place of any string argument  equalling <code>"this"</code> (similar to my jQuery method replacement demonstrated above with <code>.attr("title")</code>)</li>
<li>always prepend the jQuery selection to the arguments (so the jQuery selection is printed before the rest of the arguments)</li>
<li>always append the jQuery selection to the arguments (so the jQuery selection is printed after the rest of the arguments)</li>
</ol>
<p>I&#8217;m leaning towards either #3 or #4 but am open to feedback. Please comment with your suggestions. Keep in mind that all four above choices will still result in just one log message per <code>log()</code> call. Turning on the &#8216;<code>explicit</code>&#8216; option is the only thing that will result in more console messages than <code>log()</code> calls. Also, keep in mind that printing the jQuery selection itself to the console will allow deep inspection. For instance, clicking on the jQuery selection in Firebug shows what elements are selected, etc.</p>
<div class="rpxsocial"><div class="rpxsharebutton" onclick="rpxWPsocial('Share:','As a result of some of the discussion following from my post on my new jQuery plugin, jQuery.Firebug I&#8217;m soliciting feedba...','http://jasonkarns.com/blog/jqueryfirebug-a-call-for-feedback/','jQuery.Firebug: A call for feedback.','Shared jQuery.Firebug: A call for feedback.','','33', this);"><div class="rpx_share_label">&nbsp;</div><div class="rpx_social_icons"><div class="rpx_icon rpx_size30 rpx_facebook" title="Facebook"></div><div class="rpx_icon rpx_size30 rpx_twitter" title="Twitter"></div></div></div> &nbsp;</div> <div class="rpx_clear"></div>]]></content:encoded>
			<wfw:commentRss>http://jasonkarns.com/blog/jqueryfirebug-a-call-for-feedback/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Announcing jQuery.Firebug</title>
		<link>http://jasonkarns.com/blog/announcing-jqueryfirebug/</link>
		<comments>http://jasonkarns.com/blog/announcing-jqueryfirebug/#comments</comments>
		<pubDate>Tue, 06 Jan 2009 19:49:29 +0000</pubDate>
		<dc:creator>jasonkarns</dc:creator>
				<category><![CDATA[firebug]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[debugging]]></category>

		<guid isPermaLink="false">http://jasonkarns.com/blog/?p=5</guid>
		<description><![CDATA[I have been sitting on my latest jQuery plugin for some time now. Although I realize that the code is not yet of production quality and there are certainly bugs and features that remain to be addressed, I&#8217;ve decided that I should at least release this plugin to the wild. At the very least, I [...]]]></description>
			<content:encoded><![CDATA[<p>I have been sitting on my latest <a href="http://jquery.com/">jQuery </a> plugin for some time now. Although I realize that the code is not yet of production quality and there are certainly bugs and features that remain to be addressed, I&#8217;ve decided that I should at least release this plugin to the wild.  At the very least, I would love some feedback on it and possibly new features to be added.  &#8220;So let&#8217;s see it!&#8221; you ask?</p>
<p>jQuery.Firebug is a jQuery plugin that simply exposes the <a href="http://getfirebug.com/console.html">Firebug Console API</a> to the jQuery object. That&#8217;s about it.  Under the covers, it bridges some functionality between <a href="http://getfirebug.com/">Firebug </a> and <a href="http://getfirebug.com/lite.html">Firebug Lite</a> and has a host of other small feature.  But all in all, it simply adds the Console API methods directly to the jQuery object.</p>
<p>The goal of this plugin is to allow inspection of your jQuery selections while in the middle of a chain. For those of you who have ever had a jQuery chain like:</p>
<pre class="javascript">
$(".elements").parents("div")
.find(".new").show().end()
.find(".old").hide();</pre>
<p>and you load up the page and it doesn&#8217;t work. How do you begin debugging? You open up Firebug but are unable to easily &#8216;step through&#8217; the jQuery chain. Inevitably, you have to break up each selector, assign it to a temporary variable solely to call console.log(temp) on your selection. Enter jQuery.Firebug:</p>
<pre class="javascript">
$(".elements").log()
.parents("div").log()
.find(".new").log()
.show().end().log()
.find(".old").log()
.hide();</pre>
<p>Each log method returns the same selection that was passed to it, so you can simply continue your chain as if it weren&#8217;t even there. Every Firebug method (as of Firebug 1.2) is supported so you can call <code>debug()</code>, <code>assert()</code>, <code>info()</code>, <code>dir()</code>, <code>profile()</code>, etc.</p>
<p>There are a few additional features that I will address later as the code begins to settle down. For now, the source and documentation can be found in Subversion at <a href="http://svn.jasonkarns.com/jquery/firebug/">svn.jasonkarns.com/jquery/firebug</a>.  There is much work to be done on the plugin as well as on the documentation. Until then, let me hear any feedback you may have.</p>
<div class="rpxsocial"><div class="rpxsharebutton" onclick="rpxWPsocial('Share:','I have been sitting on my latest jQuery plugin for some time now. Although I realize that the code is not yet of production qua...','http://jasonkarns.com/blog/announcing-jqueryfirebug/','Announcing jQuery.Firebug','Shared Announcing jQuery.Firebug','','5', this);"><div class="rpx_share_label">&nbsp;</div><div class="rpx_social_icons"><div class="rpx_icon rpx_size30 rpx_facebook" title="Facebook"></div><div class="rpx_icon rpx_size30 rpx_twitter" title="Twitter"></div></div></div> &nbsp;</div> <div class="rpx_clear"></div>]]></content:encoded>
			<wfw:commentRss>http://jasonkarns.com/blog/announcing-jqueryfirebug/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
	</channel>
</rss>

