<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Sprinkle In Your JavaScript</title>
	<atom:link href="http://ajaxian.com/archives/sprinkle-in-your-javascript/feed" rel="self" type="application/rss+xml" />
	<link>http://ajaxian.com/archives/sprinkle-in-your-javascript</link>
	<description>Cleaning up the web with Ajax</description>
	<lastBuildDate>Thu, 09 Feb 2012 06:55:33 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2</generator>
	<item>
		<title>By: Jon Davis</title>
		<link>http://ajaxian.com/archives/sprinkle-in-your-javascript/comment-page-1#comment-258212</link>
		<dc:creator>Jon Davis</dc:creator>
		<pubDate>Sun, 04 Nov 2007 21:49:19 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=2786#comment-258212</guid>
		<description>While this is an old thread, I still want to make it clear what my intentions were with sprinklejs.com. I am not trying to convince anyone to use this; rather, I had a need for this functionality, I didn&#039;t want a big, bulk jQuery or Prototype support lib (3 lines of jQuery code, sure, with 48kb of support code!!), and so I sat down and produced it myself. I registered a domain name and put it out there to *share* it, not to sell myself or get rich and famous or compete with anyone.

So if you have the same need, great, enjoy! If you don&#039;t, I don&#039;t care!</description>
		<content:encoded><![CDATA[<p>While this is an old thread, I still want to make it clear what my intentions were with sprinklejs.com. I am not trying to convince anyone to use this; rather, I had a need for this functionality, I didn&#8217;t want a big, bulk jQuery or Prototype support lib (3 lines of jQuery code, sure, with 48kb of support code!!), and so I sat down and produced it myself. I registered a domain name and put it out there to *share* it, not to sell myself or get rich and famous or compete with anyone.</p>
<p>So if you have the same need, great, enjoy! If you don&#8217;t, I don&#8217;t care!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Levi Senft</title>
		<link>http://ajaxian.com/archives/sprinkle-in-your-javascript/comment-page-1#comment-255949</link>
		<dc:creator>Levi Senft</dc:creator>
		<pubDate>Sat, 22 Sep 2007 21:20:24 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=2786#comment-255949</guid>
		<description>I wrote a similar script using JQuery a while back.  The JQuery implementation is about three lines of code.  I just blogged about the script and included implementations for Prototype and several other JavaScript frameworks.  The link is:

http://www.forgeniuses.com/?p=3</description>
		<content:encoded><![CDATA[<p>I wrote a similar script using JQuery a while back.  The JQuery implementation is about three lines of code.  I just blogged about the script and included implementations for Prototype and several other JavaScript frameworks.  The link is:</p>
<p><a href="http://www.forgeniuses.com/?p=3" rel="nofollow">http://www.forgeniuses.com/?p=3</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Davis</title>
		<link>http://ajaxian.com/archives/sprinkle-in-your-javascript/comment-page-1#comment-255708</link>
		<dc:creator>Jon Davis</dc:creator>
		<pubDate>Tue, 18 Sep 2007 19:56:10 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=2786#comment-255708</guid>
		<description>.. *cough* and yes I should clean up sprinklejs.com to make it &quot;more ideal&quot;. The point is, that&#039;s not the point. :)</description>
		<content:encoded><![CDATA[<p>.. *cough* and yes I should clean up sprinklejs.com to make it &#8220;more ideal&#8221;. The point is, that&#8217;s not the point. :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Davis</title>
		<link>http://ajaxian.com/archives/sprinkle-in-your-javascript/comment-page-1#comment-255707</link>
		<dc:creator>Jon Davis</dc:creator>
		<pubDate>Tue, 18 Sep 2007 19:55:08 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=2786#comment-255707</guid>
		<description>Michael, I agree that while there are some cases where this would be ideal (literally it was for a quick sidebar navigation / advertisement component that we added to one of our magazine web sites), and several more places where it wouldn&#039;t be ideal. The site does demonstrate where it wouldn&#039;t be ideal.</description>
		<content:encoded><![CDATA[<p>Michael, I agree that while there are some cases where this would be ideal (literally it was for a quick sidebar navigation / advertisement component that we added to one of our magazine web sites), and several more places where it wouldn&#8217;t be ideal. The site does demonstrate where it wouldn&#8217;t be ideal.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Geary</title>
		<link>http://ajaxian.com/archives/sprinkle-in-your-javascript/comment-page-1#comment-255702</link>
		<dc:creator>Michael Geary</dc:creator>
		<pubDate>Tue, 18 Sep 2007 18:40:46 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=2786#comment-255702</guid>
		<description>Jon, that gets to the heart of some of the objections that a few commenters raised: The sprinklejs.com website doesn&#039;t offer a good use case for the technology. In fact, the site is a better illustration of a case where you *shouldn&#039;t* use this. Does the dynamic loading on this particular site give you anything that you couldn&#039;t do with a straight-up HTML page? Especially considering that an HTML page would have several advantages:

* Indexable by search engines
* Works in any browser
* Works if JavaScript is disabled
* Faster loading
* Fewer hits on your server

I&#039;m not saying there aren&#039;t use cases where this approach has some benefit, just that the current sprinklejs.com page isn&#039;t one of them. Put together a demo case where the dynamic loading actually offers some value, in fact enough extra value to overcome its inherent disadvantages, and then it will be easier to convince people of its merits.</description>
		<content:encoded><![CDATA[<p>Jon, that gets to the heart of some of the objections that a few commenters raised: The sprinklejs.com website doesn&#8217;t offer a good use case for the technology. In fact, the site is a better illustration of a case where you *shouldn&#8217;t* use this. Does the dynamic loading on this particular site give you anything that you couldn&#8217;t do with a straight-up HTML page? Especially considering that an HTML page would have several advantages:</p>
<p>* Indexable by search engines<br />
* Works in any browser<br />
* Works if JavaScript is disabled<br />
* Faster loading<br />
* Fewer hits on your server</p>
<p>I&#8217;m not saying there aren&#8217;t use cases where this approach has some benefit, just that the current sprinklejs.com page isn&#8217;t one of them. Put together a demo case where the dynamic loading actually offers some value, in fact enough extra value to overcome its inherent disadvantages, and then it will be easier to convince people of its merits.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Davis</title>
		<link>http://ajaxian.com/archives/sprinkle-in-your-javascript/comment-page-1#comment-255691</link>
		<dc:creator>Jon Davis</dc:creator>
		<pubDate>Tue, 18 Sep 2007 16:47:53 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=2786#comment-255691</guid>
		<description>&quot;The core issue I see with this is that without javascript, itâ€™s broken. A link to the HTML content (ie., the no-JS case) which is otherwise removed and replaced with the content of that link via JS would be more useful. &quot;

Scott, how is this broken? That should work just fine. It just doesn&#039;t work on the actual sprinklejs.com web site itself since the site doubles as a browser test. You can obviously populate the contents of your  tag with HTML while adding src=&quot;..&quot; to the tag itself, so that its contents have HTML defaults and Javascripted replacements. I just chose not to do that on the actual web site.</description>
		<content:encoded><![CDATA[<p>&#8220;The core issue I see with this is that without javascript, itâ€™s broken. A link to the HTML content (ie., the no-JS case) which is otherwise removed and replaced with the content of that link via JS would be more useful. &#8221;</p>
<p>Scott, how is this broken? That should work just fine. It just doesn&#8217;t work on the actual sprinklejs.com web site itself since the site doubles as a browser test. You can obviously populate the contents of your  tag with HTML while adding src=&#8221;..&#8221; to the tag itself, so that its contents have HTML defaults and Javascripted replacements. I just chose not to do that on the actual web site.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Geary</title>
		<link>http://ajaxian.com/archives/sprinkle-in-your-javascript/comment-page-1#comment-255663</link>
		<dc:creator>Michael Geary</dc:creator>
		<pubDate>Tue, 18 Sep 2007 00:23:04 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=2786#comment-255663</guid>
		<description>Thanks for not taking offense at our comments, Jon. You are a true gentleman. If I called your code &quot;scary&quot;, believe me, I used to write code that was much scarier!

I&#039;m just kind of an inveterate code simplifier. Here&#039;s one more for the road... :-)

&lt;code&gt;
    if (antiCacheMethod == &quot;querystring&quot;) {
        var dt = new Date();
        var dts = &quot;&quot;
            + dt.getFullYear()
            + dt.getMonth()
            + dt.getDate()
            + dt.getHours()
            + dt.getMinutes()
            + dt.getSeconds();
        if (src.indexOf(&quot;?&quot;) == -1) src += &quot;?nocachetimestamp=&quot; + dts;
        else src += &quot;&amp;nocachetimestamp=&quot; + dts;
    }
&lt;/code&gt;

could be:

&lt;code&gt;
    if (antiCacheMethod == &quot;querystring&quot;) {
        src +=
            ( src.match(/\?/) ? &#039;&amp;&#039; : &#039;?&#039; ) +
            &#039;nocachetimestamp=&#039; + (new Date).getTime();
    }
&lt;/code&gt;

Note that this also gives you a timestamp with &quot;millisecond&quot; resolution (actually around 15 milliseconds on many platforms), instead of the one second resolution in the original code.

I look forward to seeing your new streamlined revision... :-)</description>
		<content:encoded><![CDATA[<p>Thanks for not taking offense at our comments, Jon. You are a true gentleman. If I called your code &#8220;scary&#8221;, believe me, I used to write code that was much scarier!</p>
<p>I&#8217;m just kind of an inveterate code simplifier. Here&#8217;s one more for the road&#8230; :-)</p>
<p><code><br />
    if (antiCacheMethod == "querystring") {<br />
        var dt = new Date();<br />
        var dts = ""<br />
            + dt.getFullYear()<br />
            + dt.getMonth()<br />
            + dt.getDate()<br />
            + dt.getHours()<br />
            + dt.getMinutes()<br />
            + dt.getSeconds();<br />
        if (src.indexOf("?") == -1) src += "?nocachetimestamp=" + dts;<br />
        else src += "&amp;nocachetimestamp=" + dts;<br />
    }<br />
</code></p>
<p>could be:</p>
<p><code><br />
    if (antiCacheMethod == "querystring") {<br />
        src +=<br />
            ( src.match(/\?/) ? '&amp;' : '?' ) +<br />
            'nocachetimestamp=' + (new Date).getTime();<br />
    }<br />
</code></p>
<p>Note that this also gives you a timestamp with &#8220;millisecond&#8221; resolution (actually around 15 milliseconds on many platforms), instead of the one second resolution in the original code.</p>
<p>I look forward to seeing your new streamlined revision&#8230; :-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Davis</title>
		<link>http://ajaxian.com/archives/sprinkle-in-your-javascript/comment-page-1#comment-255662</link>
		<dc:creator>Jon Davis</dc:creator>
		<pubDate>Tue, 18 Sep 2007 00:05:54 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=2786#comment-255662</guid>
		<description>Hey guys, 

Thx for the feedback on my Sprinkle. I totally agree that the code should be cleaned up. I just my idea was a cool one, even if it isn&#039;t the most beautiful implementation around. :) I&#039;ll likely do a lot of refactoring.

Jon</description>
		<content:encoded><![CDATA[<p>Hey guys, </p>
<p>Thx for the feedback on my Sprinkle. I totally agree that the code should be cleaned up. I just my idea was a cool one, even if it isn&#8217;t the most beautiful implementation around. :) I&#8217;ll likely do a lot of refactoring.</p>
<p>Jon</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Geary</title>
		<link>http://ajaxian.com/archives/sprinkle-in-your-javascript/comment-page-1#comment-255627</link>
		<dc:creator>Michael Geary</dc:creator>
		<pubDate>Mon, 17 Sep 2007 17:11:32 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=2786#comment-255627</guid>
		<description>I hate this comment system. No preview, no editing, a tiny narrow fixed width theme, and it screws up any source code I try to post!

Ajaxians, fix this thing. Kill it and get something that works. You should expect that people will want to post code in the comments, right?

Check my blog for an example of how you can have comments with good readable code formatting - in fact the same formatting as the posts themselves. Take this discussion for example:

http://mg.to/2006/01/25/json-for-jquery

If I can do it, you can do it. :-)

(Sorry, you wouldn&#039;t be able to use my code &quot;as is&quot; because the site uses Drupal - but you&#039;re welcome to use the code formatting part if you want to adapt it to WordPress - it&#039;s based on the GeSHi code formatter with some tweaks of my own for the zebra striping and such.)</description>
		<content:encoded><![CDATA[<p>I hate this comment system. No preview, no editing, a tiny narrow fixed width theme, and it screws up any source code I try to post!</p>
<p>Ajaxians, fix this thing. Kill it and get something that works. You should expect that people will want to post code in the comments, right?</p>
<p>Check my blog for an example of how you can have comments with good readable code formatting &#8211; in fact the same formatting as the posts themselves. Take this discussion for example:</p>
<p><a href="http://mg.to/2006/01/25/json-for-jquery" rel="nofollow">http://mg.to/2006/01/25/json-for-jquery</a></p>
<p>If I can do it, you can do it. :-)</p>
<p>(Sorry, you wouldn&#8217;t be able to use my code &#8220;as is&#8221; because the site uses Drupal &#8211; but you&#8217;re welcome to use the code formatting part if you want to adapt it to WordPress &#8211; it&#8217;s based on the GeSHi code formatter with some tweaks of my own for the zebra striping and such.)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Geary</title>
		<link>http://ajaxian.com/archives/sprinkle-in-your-javascript/comment-page-1#comment-255626</link>
		<dc:creator>Michael Geary</dc:creator>
		<pubDate>Mon, 17 Sep 2007 17:03:55 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=2786#comment-255626</guid>
		<description>In all fairness, the Sprinkle code does a lot more than the three-line jQuery or Prototype versions. But it seems to be doing more than it needs to - some of the options aren&#039;t really necessary.

Here&#039;s some more of the source code:

&lt;code&gt;
function csiGetInnerHtmlOfTag(str, tagName) {
    
    if (str.toLowerCase().indexOf(&quot;&lt;&quot; + tagName) &gt; -1 &amp;&amp;
        str.toLowerCase().indexOf(&quot;&lt;/&quot; + tagName + &quot;&gt;&quot;, 
        str.toLowerCase().indexOf(&quot;&lt;&quot; + tagName)) &gt; -1) {
        
        var startTagStart = str.toLowerCase().indexOf(&quot;&lt;&quot; + tagName);
        var startTagEnd = str.indexOf(&quot;&gt;&quot;, startTagStart);
        var endTagStart = str.toLowerCase().indexOf(&quot;&lt;/&quot; + tagName, startTagEnd);
        
        var ret = str.substring(startTagEnd + 1, endTagStart - 1);
        return ret;
        
    } else return str;
}
&lt;/code&gt;

That one function calls &lt;code&gt;str.toLowerCase()&lt;/code&gt; five times. It calls &lt;code&gt;str.toLowerCase().indexOf(&quot;&lt;&quot; + tagName)&lt;/code&gt; three times. It calls &lt;code&gt;str.toLowerCase().indexOf(&quot;&lt;/&quot; + tagName + &quot;&gt;&quot;, str.toLowerCase().indexOf(&quot;&lt;&quot; + tagName))&lt;/code&gt; twice!

Clearly some refactoring would be in order here. Or you could do the whole thing with one regular expression:

&lt;code&gt;
function getInnerHtmlOfTag(str, tagName) {
    var match = str.match(
        new RegExp( &#039;&lt;&#039; + tagName + &#039;[^&gt;]*&gt;(.*)&lt;/&#039; + tagName + &#039;&gt;&#039;, &#039;i&#039; ) );
    return match ? match[1] : str;
}
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>In all fairness, the Sprinkle code does a lot more than the three-line jQuery or Prototype versions. But it seems to be doing more than it needs to &#8211; some of the options aren&#8217;t really necessary.</p>
<p>Here&#8217;s some more of the source code:</p>
<p><code><br />
function csiGetInnerHtmlOfTag(str, tagName) {</p>
<p>    if (str.toLowerCase().indexOf("&lt;" + tagName) &gt; -1 &amp;&amp;<br />
        str.toLowerCase().indexOf("&lt;/" + tagName + "&gt;",<br />
        str.toLowerCase().indexOf("&lt;" + tagName)) &gt; -1) {</p>
<p>        var startTagStart = str.toLowerCase().indexOf("&lt;" + tagName);<br />
        var startTagEnd = str.indexOf("&gt;", startTagStart);<br />
        var endTagStart = str.toLowerCase().indexOf("&lt;/" + tagName, startTagEnd);</p>
<p>        var ret = str.substring(startTagEnd + 1, endTagStart - 1);<br />
        return ret;</p>
<p>    } else return str;<br />
}<br />
</code></p>
<p>That one function calls <code>str.toLowerCase()</code> five times. It calls <code>str.toLowerCase().indexOf("&lt;" + tagName)</code> three times. It calls <code>str.toLowerCase().indexOf("&lt;/" + tagName + "&gt;", str.toLowerCase().indexOf("&lt;" + tagName))</code> twice!</p>
<p>Clearly some refactoring would be in order here. Or you could do the whole thing with one regular expression:</p>
<p><code><br />
function getInnerHtmlOfTag(str, tagName) {<br />
    var match = str.match(<br />
        new RegExp( '&lt;' + tagName + '[^&gt;]*&gt;(.*)&lt;/' + tagName + '&gt;', 'i' ) );<br />
    return match ? match[1] : str;<br />
}<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Heilmann</title>
		<link>http://ajaxian.com/archives/sprinkle-in-your-javascript/comment-page-1#comment-255622</link>
		<dc:creator>Chris Heilmann</dc:creator>
		<pubDate>Mon, 17 Sep 2007 15:42:20 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=2786#comment-255622</guid>
		<description>Hands up, who else remembers ?</description>
		<content:encoded><![CDATA[<p>Hands up, who else remembers ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott Schiller</title>
		<link>http://ajaxian.com/archives/sprinkle-in-your-javascript/comment-page-1#comment-255621</link>
		<dc:creator>Scott Schiller</dc:creator>
		<pubDate>Mon, 17 Sep 2007 15:40:43 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=2786#comment-255621</guid>
		<description>The core issue I see with this is that without javascript, it&#039;s broken. A link to the HTML content (ie., the no-JS case) which is otherwise removed and replaced with the content of that link via JS would be more useful.</description>
		<content:encoded><![CDATA[<p>The core issue I see with this is that without javascript, it&#8217;s broken. A link to the HTML content (ie., the no-JS case) which is otherwise removed and replaced with the content of that link via JS would be more useful.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mike</title>
		<link>http://ajaxian.com/archives/sprinkle-in-your-javascript/comment-page-1#comment-255613</link>
		<dc:creator>mike</dc:creator>
		<pubDate>Mon, 17 Sep 2007 14:50:19 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=2786#comment-255613</guid>
		<description>Prototype 3 lines:
$$(â€™textarea[src],div[src],span[src]â€™).each(function(el){
  new Ajax.Updater(el, el.src&#124;&#124;&#039;&#039;);
});</description>
		<content:encoded><![CDATA[<p>Prototype 3 lines:<br />
$$(â€™textarea[src],div[src],span[src]â€™).each(function(el){<br />
  new Ajax.Updater(el, el.src||&#8221;);<br />
});</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marty</title>
		<link>http://ajaxian.com/archives/sprinkle-in-your-javascript/comment-page-1#comment-255608</link>
		<dc:creator>Marty</dc:creator>
		<pubDate>Mon, 17 Sep 2007 14:24:16 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=2786#comment-255608</guid>
		<description>Great idea kaniz. 

Tx jdalton!</description>
		<content:encoded><![CDATA[<p>Great idea kaniz. </p>
<p>Tx jdalton!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kaniz</title>
		<link>http://ajaxian.com/archives/sprinkle-in-your-javascript/comment-page-1#comment-255607</link>
		<dc:creator>kaniz</dc:creator>
		<pubDate>Mon, 17 Sep 2007 14:17:49 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=2786#comment-255607</guid>
		<description>Can we make this an ongoing Ajaxian game - take long, bloated, scary javascript code from other projects and see how few lines we can re-create it with using jQuery/ProtoType/etc? 

note: 100% serious, I&#039;ve found it rather amusing, interesting (and increasing my desire to sit down and learn one of these frameworks) when I see X project/source posted, followed by the 3-line jQuery alternative in the comments :)</description>
		<content:encoded><![CDATA[<p>Can we make this an ongoing Ajaxian game &#8211; take long, bloated, scary javascript code from other projects and see how few lines we can re-create it with using jQuery/ProtoType/etc? </p>
<p>note: 100% serious, I&#8217;ve found it rather amusing, interesting (and increasing my desire to sit down and learn one of these frameworks) when I see X project/source posted, followed by the 3-line jQuery alternative in the comments :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jdalton</title>
		<link>http://ajaxian.com/archives/sprinkle-in-your-javascript/comment-page-1#comment-255605</link>
		<dc:creator>jdalton</dc:creator>
		<pubDate>Mon, 17 Sep 2007 13:53:28 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=2786#comment-255605</guid>
		<description>//add support for input elements
if(element.tagName == &#039;INPUT&#039;){
  new Ajax.Request(element.src&#124;&#124;&#039;&#039;, {
    method:&#039;get&#039;,
    onSuccess:function(transport){
      element.value = transport.responseText;
    }
  });
}</description>
		<content:encoded><![CDATA[<p>//add support for input elements<br />
if(element.tagName == &#8216;INPUT&#8217;){<br />
  new Ajax.Request(element.src||&#8221;, {<br />
    method:&#8217;get&#8217;,<br />
    onSuccess:function(transport){<br />
      element.value = transport.responseText;<br />
    }<br />
  });<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jdalton</title>
		<link>http://ajaxian.com/archives/sprinkle-in-your-javascript/comment-page-1#comment-255604</link>
		<dc:creator>jdalton</dc:creator>
		<pubDate>Mon, 17 Sep 2007 13:50:06 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=2786#comment-255604</guid>
		<description>In Prototype:
//create element method &#039;loadSrc&#039;
Element.addMethods({
  loadSrc: function(element, options){
    element = $(element);
    new Ajax.Updater(element, element.src&#124;&#124;&#039;&#039;, options); 
    return element;
  }
});

//execute &#039;loadSrc&#039; on queried elements
$$(&#039;textarea[src],div[src],span[src]&#039;).invoke(&#039;loadSrc&#039;, options);</description>
		<content:encoded><![CDATA[<p>In Prototype:<br />
//create element method &#8216;loadSrc&#8217;<br />
Element.addMethods({<br />
  loadSrc: function(element, options){<br />
    element = $(element);<br />
    new Ajax.Updater(element, element.src||&#8221;, options);<br />
    return element;<br />
  }<br />
});</p>
<p>//execute &#8216;loadSrc&#8217; on queried elements<br />
$$(&#8216;textarea[src],div[src],span[src]&#8216;).invoke(&#8216;loadSrc&#8217;, options);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan Atkinson</title>
		<link>http://ajaxian.com/archives/sprinkle-in-your-javascript/comment-page-1#comment-255598</link>
		<dc:creator>Dan Atkinson</dc:creator>
		<pubDate>Mon, 17 Sep 2007 12:29:46 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=2786#comment-255598</guid>
		<description>I&#039;ll actually rate this, based on Yehuda&#039;s three line jQuery alternative alone.</description>
		<content:encoded><![CDATA[<p>I&#8217;ll actually rate this, based on Yehuda&#8217;s three line jQuery alternative alone.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Frank Thuerigen</title>
		<link>http://ajaxian.com/archives/sprinkle-in-your-javascript/comment-page-1#comment-255595</link>
		<dc:creator>Frank Thuerigen</dc:creator>
		<pubDate>Mon, 17 Sep 2007 11:38:02 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=2786#comment-255595</guid>
		<description>Sry just saw Yehudas jQ solution... nothing to add.</description>
		<content:encoded><![CDATA[<p>Sry just saw Yehudas jQ solution&#8230; nothing to add.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Frank Thuerigen</title>
		<link>http://ajaxian.com/archives/sprinkle-in-your-javascript/comment-page-1#comment-255593</link>
		<dc:creator>Frank Thuerigen</dc:creator>
		<pubDate>Mon, 17 Sep 2007 11:30:18 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=2786#comment-255593</guid>
		<description>Hey gents,
give him a break... the idea behind it is valid... IÂ´ll have a closer look at the code.</description>
		<content:encoded><![CDATA[<p>Hey gents,<br />
give him a break&#8230; the idea behind it is valid&#8230; IÂ´ll have a closer look at the code.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

