<?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>overfloweblog &#187; prototype</title>
	<atom:link href="http://overfloweb.com/blog/index.php/archives/tag/prototype/feed" rel="self" type="application/rss+xml" />
	<link>http://overfloweb.com/blog</link>
	<description>are you driving me crazy?</description>
	<lastBuildDate>Sun, 13 May 2012 16:59:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>How well do you know prototype (part II)</title>
		<link>http://overfloweb.com/blog/index.php/archives/11</link>
		<comments>http://overfloweb.com/blog/index.php/archives/11#comments</comments>
		<pubDate>Tue, 01 Apr 2008 04:29:00 +0000</pubDate>
		<dc:creator>overflow</dc:creator>
				<category><![CDATA[javaScript]]></category>
		<category><![CDATA[prototype]]></category>

		<guid isPermaLink="false">http://overflow.ivyro.net/?p=11</guid>
		<description><![CDATA[1) Detecting key events easily How do we detect which key was pressed? Prototype provides set of key event aliases so that we don’t have to remember that return is “13″ and escape is “27″. Almost all major keys are aliased: KEY_RETURN, KEY_ESC, KEY_TAB, KEY_LEFT, KEY_UP, KEY_RIGHT, KEY_DOWN. See full list in API docs $('myInput').observe('keyup', [...]]]></description>
			<content:encoded><![CDATA[<div class="entry" style="font-family: verdana,arial,helvetica,sans-serif;">
<h3>1) Detecting key events easily</h3>
<p>How do we detect which key was pressed? Prototype provides set of<br />
key event aliases so that we don’t have to remember that return is “13″<br />
and escape is “27″. Almost all major keys are aliased: KEY_RETURN,<br />
KEY_ESC, KEY_TAB, KEY_LEFT, KEY_UP, KEY_RIGHT, KEY_DOWN. See full list <a title="Event's KEY aliases" href="http://prototypejs.org/api/event">in API docs</a></p>
<div class="wp_syntax">
<div class="code">
<pre class="javascript">
<div style="padding: 10px; background-color: #c9edff;">$('myInput').observe('keyup', function(e){
if (e.keyCode == Event.KEY_TAB)
doSomethingCoolWhenTabIsPressed();
})</div>
</pre>
</div>
</div>
<h3>2) You won’t need event capturing (most likely)</h3>
<p>Sometimes I see capturing phase being explicitly set to false in<br />
Event’s observe method. The good thing is that it’s set to false by<br />
default and you would rarely need to use it. The following 2 lines are<br />
fully identical so we can just skip this last argument:</p>
<div class="wp_syntax">
<div class="code">
<pre class="javascript">
<div style="padding: 10px; background-color: #c9edff;">Event.observe('productInfo', 'click', displayProductInfo, false); // 'false' could be skipped
Event.observe('productInfo', 'click', displayProductInfo);</div>
</pre>
</div>
</div>
<p>or a short way:</p>
<div class="wp_syntax">
<div class="code">
<pre class="javascript">
<div style="padding: 10px; background-color: #c9edff;">$('productInfo').observe('click', displayProductInfo, false); // 'false' could be skipped
$('productInfo').observe('click', displayProductInfo);</div>
</pre>
</div>
</div>
<h3>3) insert() wisely</h3>
<p>Another one of those “it’s-there-by-default” values is a position<br />
argument of Element’s insert method. Surprisingly it’s not mentioned<br />
anywhere in the docs &#8211; I accidentally found it wondering through the<br />
source one day. insert accepts one of four position values: <strong>top</strong>, <strong>bottom</strong>, <strong>before</strong>, and <strong>after</strong>. If we omit this argument, it defaults to <strong>bottom</strong> (and luckily this happens to be the most common case). The following lines behave identically:</p>
<div class="wp_syntax">
<div class="code">
<pre class="javascript">
<div style="padding: 10px; background-color: #c9edff;"><strong>new Insertion.Bottom('blogEntry',
new Template('&lt;div&gt;&lt;h2&gt;#{name}&lt;/h2&gt;&lt;p&gt;#{content}&lt;/p&gt;&lt;/div&gt;')
.evaluate({
name: blogEntry.name,
content: blogEntry.content
}));
 
// Insertion class is deprecated - it's recommended to use Element's insert method:
 
$('blogEntry').insert(new Template('&lt;div&gt;&lt;h2&gt;#{name}&lt;/h2&gt;&lt;p&gt;#{content}&lt;/p&gt;&lt;/div&gt;')
.evaluate({
name: blogEntry.name,
content: blogEntry.content
}), 'bottom' ); // "bottom" can be skipped
 
$('blogEntry').insert(new Template('&lt;div&gt;&lt;h2&gt;#{name}&lt;/h2&gt;&lt;p&gt;#{content}&lt;/p&gt;&lt;/div&gt;')
.evaluate({
name: blogEntry.name,
content: blogEntry.content
}));
</strong></div>
</pre>
</div>
</div>
<h3>4) Forms gone wild</h3>
<p>Plain form submission is quite easy but what if we want to prevent<br />
certain elements from being serialized before submitting form via ajax?<br />
Let’s take a look at few ways to do this:</p>
<p>Plain form submission using .request</p>
<div class="wp_syntax">
<div class="code">
<pre class="javascript">
<div style="padding: 10px; background-color: #c9edff;">$('register').observe('submit', function(e){
Event.stop(e);
$(this).request();
})</div>
</pre>
</div>
</div>
<p>Using .getInputs makes it easy to filter out elements based on type<br />
and name attributes. In this example we’re serializing elements with<br />
name ‘email’ and submitting result to the URI contained in form’s<br />
“action” attribute</p>
<div class="wp_syntax">
<div class="code">
<pre class="javascript">
<div style="padding: 10px; background-color: #c9edff;">$('register').observe('submit', function(e){
Event.stop(e);
new Ajax.Request($(this).readAttribute('action'), {
parameters: Form.serializeElements($(this).getInputs('', 'email'))
})
})</div>
</pre>
</div>
</div>
<p>Using .getInputs could help most of the time but what if we want to<br />
exclude elements that have “multiple” attribute? We might try something<br />
like this:</p>
<div class="wp_syntax">
<div class="code">
<pre class="javascript">
<div style="padding: 10px; background-color: #c9edff;">$('register').observe('submit', function(e){
Event.stop(e);
new Ajax.Request(this.readAttribute('action'), {
parameters: Form.serializeElements($(this).getElements()
.reject(function(el){return el.hasAttribute('multiple')})
);
})
})</div>
</pre>
</div>
</div>
<p class="colored">Wow, what’s going on over here?!</p>
<p>When submit event occurs, we prevent default submit action <code>Event.stop(e)</code>, get all form’s elements <code>this.getElements()</code>, iterate over them REJECTING those that have “multiple” attribute <code>.reject(function(el){return el.hasAttribute('multiple')})</code>. The filtered collection is then serialized <code>Form.serializeElements()</code> and is submitted via ajax <code>new Ajax.Request()</code></p>
<p>This is all very cool but here’s the reason why learning CSS3<br />
selectors might be a good thing (the results from both &#8211; reject-based<br />
and selector-based filtering are the same):</p>
<div class="wp_syntax">
<div class="code">
<pre class="javascript">
<div style="padding: 10px; background-color: #c9edff;">$('register').observe('submit', function(e){
Event.stop(e);
new Ajax.Request($(this).readAttribute('action'), {
parameters: Form.serializeElements($$('#register input:not([multiple])'))
})
})</div>
</pre>
</div>
</div>
<h3>Enjoy prototyping!</h3>
<p><a href="http://thinkweb2.com/projects/prototype/?p=3" target="_blank">http://thinkweb2.com/projects/prototype/?p=3</a></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://overfloweb.com/blog/index.php/archives/11/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How well do you know prototype?</title>
		<link>http://overfloweb.com/blog/index.php/archives/7</link>
		<comments>http://overfloweb.com/blog/index.php/archives/7#comments</comments>
		<pubDate>Mon, 31 Mar 2008 15:14:40 +0000</pubDate>
		<dc:creator>overflow</dc:creator>
				<category><![CDATA[javaScript]]></category>
		<category><![CDATA[prototype]]></category>

		<guid isPermaLink="false">http://overflow.ivyro.net/?p=7</guid>
		<description><![CDATA[How well do you know prototypeor taking advantage of those extra 100 KB in your pageLet&#8217;s be honest &#8211; I&#8217;m tired of answering same questions over and over again. Prototype.js is a widely used javascript library with somewhat confusing online documentation. I personally find API reference to be a great resourse overall (with few glithes [...]]]></description>
			<content:encoded><![CDATA[<p><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-size: medium;"><span style="font-family: verdana,arial,helvetica,sans-serif; font-weight: bold;">How well do you know prototype</span></span><br style="font-family: verdana,arial,helvetica,sans-serif; font-weight: bold;" /><span style="font-family: verdana,arial,helvetica,sans-serif; font-weight: bold; color: #177fcd;">or taking advantage of those extra 100 KB in your page</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Let&#8217;s be honest &#8211; I&#8217;m tired of answering same questions over and over again. Prototype.js is a widely used javascript library with somewhat confusing online documentation. I personally find API reference to be a great resourse overall (with few glithes of course), but it&#8217;s far from being newbie-friendly. I&#8217;ve been developing with prototype for almost a year now and have been spending a lot of time on the IRC channel. It&#8217;s hard to explain what kind of nonsense people are asking sometimes. It seems to me that most of the time prototype is used at 15%, not more. I&#8217;m not surprised anymore to see Ajax.Request used with document.getElementById on one line</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Here, I&#8217;ve collected most common use cases that do NOT use all of prototype&#8217;s capabilities and their simple solutions. I hope this will be a basic checklist to go through when developing for your next project. So&#8230; Here we go:</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif; font-weight: bold;">1</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">The wrong way:</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;"></p>
<div style="padding: 10px; background-color: #c9edff;">document.getElementById(&#8216;foo&#8217;)</div>
<p></span></p>
<p><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">The right way:</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;"></p>
<div style="padding: 10px; background-color: #c9edff;">$(&#8216;foo&#8217;)</div>
<p></span></p>
<p><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Surprisingly some people actually don&#8217;t know about this one ( including ~100KB file just to use Ajax.Request family )</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif; font-weight: bold;">2</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">The wrong way:</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /></p>
<div style="padding: 10px; background-color: #c9edff;"><span style="font-family: verdana,arial,helvetica,sans-serif;">var woot = document.getElementById(&#8216;bar&#8217;).value</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">var woot = $(&#8216;bar&#8217;).value</span></div>
<p><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">The right way:</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;"></p>
<div style="padding: 10px; background-color: #c9edff;">var woot = $F(&#8216;bar&#8217;)</div>
<p></span></p>
<p><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Handy shortcut for reading a value of a form control</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif; font-weight: bold;">3</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">The wrong way:<br />
<br style="font-family: verdana,arial,helvetica,sans-serif;" /></span></p>
<div style="padding: 10px; background-color: #c9edff;"><span style="font-family: verdana,arial,helvetica,sans-serif;">$(&#8216;footer&#8217;).style.height = &#8217;100px&#8217;;<br />
</span><span style="font-family: verdana,arial,helvetica,sans-serif;">$(&#8216;footer&#8217;).style.background = &#8216;#ffc&#8217;; </span></div>
<p><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">The right way:</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /></p>
<div style="padding: 10px; background-color: #c9edff;"><span style="font-family: verdana,arial,helvetica,sans-serif;">$(&#8216;footer&#8217;).setStyle({</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">    height: &#8217;100px&#8217;,</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">    background: &#8216;#ffc&#8217;</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">})</span></div>
<p><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Dreaming about IE behaving W3C way? Not happenning! (but second construct will make you forget about cross-browser glitches)</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif; font-weight: bold;">4</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">The wrong way:</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;"></p>
<div style="padding: 10px; background-color: #c9edff;">$(&#8216;coolestWidgetEver&#8217;).innerHTML = &#8216;some nifty content&#8217;</div>
<p></span></p>
<p><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">The right way:</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;"></p>
<div style="padding: 10px; background-color: #c9edff;">$(&#8216;coolestWidgetEver&#8217;).update(&#8216;some nifty content&#8217;)</div>
<p></span></p>
<p><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">One of those simple ones yet quite often forgotten. Yes, I know they are almost the same but I want to see you doing THIS with the first one</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">(isn&#8217;t chaining just cool?)</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;"></p>
<div style="padding: 10px; background-color: #c9edff;">$(&#8216;coolestWidgetEver&#8217;).update(&#8216;some nifty content&#8217;).addClassName(&#8216;highlight&#8217;).next().hide()</div>
<p></span></p>
<p><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif; font-weight: bold;">5</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">The wrong way:<br />
<br style="font-family: verdana,arial,helvetica,sans-serif;" /></span></p>
<div style="padding: 10px; background-color: #c9edff;"><span style="font-family: verdana,arial,helvetica,sans-serif;">new Ajax.Request(&#8216;ninja.php?weapon1=foo&amp;weapon2=bar&#8217;)</span></div>
<p><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">The right way:</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /></p>
<div style="padding: 10px; background-color: #c9edff;"><span style="font-family: verdana,arial,helvetica,sans-serif;">new Ajax.Request(&#8216;ninja.php&#8217;, {</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">    parameters: {</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">        weapon1: &#8216;foo&#8217;,</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">        weapon2: &#8216;bar&#8217;</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">    }</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">})</span></div>
<p><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Cleaner and better structured parameters definition</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif; font-weight: bold;">6</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">The wrong way:</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /></p>
<div style="padding: 10px; background-color: #c9edff;"><span style="font-family: verdana,arial,helvetica,sans-serif;">new Ajax.Request(&#8216;blah.php&#8217;, {</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">    method: &#8216;POST&#8217;,</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">    asynchronous: true,</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">    contentType: &#8216;application/x-www-form-urlencoded&#8217;,</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">    encoding: &#8216;UTF-8&#8242;,</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">})</span></div>
<p><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">The right way:</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;"></p>
<div style="padding: 10px; background-color: #c9edff;">new Ajax.Request(&#8216;blah.php&#8217;)</div>
<p></span></p>
<p><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">All of these options are in Ajax.Request by default! &#8220;method: &#8216;POST&#8217;&#8221; happens to be on every second pastie page I&#8217;ve seen</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">(Still don&#8217;t believe in JS inheritance? You don&#8217;t have to. Just take advantage of it)</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif; font-weight: bold;">7</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">The wrong way:</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;"></p>
<div style="padding: 10px; background-color: #c9edff;">Event.observe(&#8216;myContainer&#8217;, &#8216;click&#8217;, doSomeMagic)</div>
<p></span></p>
<p><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">The right way:</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;"></p>
<div style="padding: 10px; background-color: #c9edff;">$(&#8216;myContainer&#8217;).observe(&#8216;click&#8217;, doSomeMagic)</div>
<p></span></p>
<p><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">This one is debatable but second way is more Object Oriented (well&#8230; sort of) and easier to chain (So decide for yourself)</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif; font-weight: bold;">8</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">The wrong way:</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /></p>
<div style="padding: 10px; background-color: #c9edff;"><span style="font-family: verdana,arial,helvetica,sans-serif;">$$(&#8216;div.hidden&#8217;).each(function(el){</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">    el.show();</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">})</span></div>
<p><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">The right way:</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;"></p>
<div style="padding: 10px; background-color: #c9edff;">$$(&#8216;div.hidden&#8217;).invoke(&#8216;show&#8217;)</div>
<p></span></p>
<p><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Here&#8217;s a typical &#8220;each overuse&#8221;. We have invoke for such things, folks! Sadly not many people know about it.</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif; font-weight: bold;">9</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">The wrong way:</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /></p>
<div style="padding: 10px; background-color: #c9edff;"><span style="font-family: verdana,arial,helvetica,sans-serif;">$$(&#8216;div.collapsed&#8217;).each(function(el){</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">    el.observe(&#8216;click&#8217;, expand);</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">})</span></div>
<p><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">The right way:</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;"></p>
<div style="padding: 10px; background-color: #c9edff;">$$(&#8216;div.collapsed&#8217;).invoke(&#8216;observe&#8217;, &#8216;click&#8217;, expand)</div>
<p></span></p>
<p><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Ha! Take this! Invoke can also be used for event handling when iterating over a collection of elements. It&#8217;s really easy, isn&#8217;t it?</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif; font-weight: bold;">10</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">The wrong way:</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /></p>
<div style="padding: 10px; background-color: #c9edff;"><span style="font-family: verdana,arial,helvetica,sans-serif;">$$(&#8216;input.date&#8217;).invoke(&#8216;observe&#8217;, &#8216;focus&#8217;, onFocus);</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">$$(&#8216;input.date&#8217;).invoke(&#8216;observe&#8217;, &#8216;blur&#8217;, onBlur);</span></div>
<p><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">The right way:</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /></p>
<div style="padding: 10px; background-color: #c9edff;"><span style="font-family: verdana,arial,helvetica,sans-serif;">$$(&#8216;input.date&#8217;)</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">    .invoke(&#8216;observe&#8217;, &#8216;focus&#8217;, onFocus)</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">        .invoke(&#8216;observe&#8217;, &#8216;blur&#8217;, onBlur)</span></div>
<p><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Somehow people tend to forget about &#8220;chaining nirvana&#8221;. Don&#8217;t like the way it looks? Think about saving some time by NOT invoking $$ twice!</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif; font-weight: bold;">11</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">The wrong way:</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /></p>
<div style="padding: 10px; background-color: #c9edff;"><span style="font-family: verdana,arial,helvetica,sans-serif;">$(&#8216;productTable&#8217;).innerHTML = </span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">    $(&#8216;productTable&#8217;).innerHTML + </span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">    &#8217;&lt;tr&gt;&lt;td&gt;&#8217; + productId + &#8216; &#8216;</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">    + productName + &#8216;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&#8217; </span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">    + productId + &#8216; &#8216; + productPrice + </span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">    &#8217;&lt;/td&gt;&lt;/tr&gt;&#8217;</span></div>
<p><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">The right way:</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /></p>
<div style="padding: 10px; background-color: #c9edff;"><span style="font-family: verdana,arial,helvetica,sans-serif;">var rowTemplate = new Template(&#8216;&lt;tr&gt;&lt;td&gt;#{id} #{name}&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;#{id} #{price}&lt;/td&gt;&lt;/tr&gt;&#8217;);</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">$(&#8216;productTable&#8217;).insert(</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">    rowTemplate.evaluate({</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">        id: productId,</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">        name: productName,</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">        price: productPrice</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">    }))</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">)</span></div>
<p><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">No I&#8217;m not kidding. This has been posted to #prototype and something was wrong with it (hmm&#8230; I wonder what)</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Templates are great for those nasty HTML strings. Those humongous concatenated constructs make me feel slightly nauseous</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">evaluate takes care of all the parsing in a nice structured way</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">That&#8217;s all for now. Stay tuned as there is always a room for improvement!</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Created by kangax</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><span style="font-family: verdana,arial,helvetica,sans-serif;">Questions? Suggestions? Find me in #prototype [kangax] or shoot me an email [ kangax@gmail.com ]</span><br style="font-family: verdana,arial,helvetica,sans-serif;" /><br />
<a href="http://thinkweb2.com/projects/prototype-checklist/" target="_blank">http://thinkweb2.com/projects/prototype-checklist/</a><br style="font-family: verdana,arial,helvetica,sans-serif;" /></p>
]]></content:encoded>
			<wfw:commentRss>http://overfloweb.com/blog/index.php/archives/7/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>prototype.js utility functions</title>
		<link>http://overfloweb.com/blog/index.php/archives/5</link>
		<comments>http://overfloweb.com/blog/index.php/archives/5#comments</comments>
		<pubDate>Mon, 31 Mar 2008 15:04:58 +0000</pubDate>
		<dc:creator>overflow</dc:creator>
				<category><![CDATA[javaScript]]></category>
		<category><![CDATA[prototype]]></category>

		<guid isPermaLink="false">http://overflow.ivyro.net/?p=5</guid>
		<description><![CDATA[$() 함수 사용하기 $()함수는 가장 많이 사용되는 DOM의 document.getElementById()함수에 대한 편리한 단축키이다. DOM함수처럼, 이것은 인자로 던져진 id를 가진 요소를 하나 반환한다. 하지만 DOM함수와는 달리, 이것은 여러개의 id를 사용할수 있고 $()는 요청된 요소를 가진 Array객체를 반환할것이다. 예제는 아래와 같다. &#60;HTML&#62; &#60;HEAD&#62; &#60;TITLE&#62; Test Page &#60;/TITLE&#62; &#60;script src="prototype-1.4.0.js"&#62;&#60;/script&#62; &#60;script&#62; function test1() { var d = $('myDiv'); alert(d.innerHTML); [...]]]></description>
			<content:encoded><![CDATA[<h4><span class="functionName">$()</span> 함수 사용하기</h4>
<p><span class="code">$()</span>함수는 가장 많이 사용되는 DOM의 <span class="code">document.getElementById()</span>함수에 대한 편리한 단축키이다. DOM함수처럼, 이것은 인자로 던져진 id를 가진 요소를 하나 반환한다.</p>
<p>하지만 DOM함수와는 달리, 이것은 여러개의 id를 사용할수 있고 <span class="code">$()</span>는 요청된 요소를 가진 <span class="code">Array</span>객체를 반환할것이다. 예제는 아래와 같다.</p>
<pre class="code">
<div style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; PADDING-TOP: 10px; BACKGROUND-COLOR: #e4e4e4">
<pre class="code">&lt;HTML&gt;
&lt;HEAD&gt;
&lt;TITLE&gt; Test Page &lt;/TITLE&gt;
&lt;script src="prototype-1.4.0.js"&gt;&lt;/script&gt;</pre>
<pre class="code">&lt;script&gt;
 function test1()
 {
  var d = $('myDiv');
  alert(d.innerHTML);
 }</pre>
<pre class="code"> function test2()
 {
  var divs = $('myDiv','myOtherDiv');
  for(i=0; i&lt;divs.length; i++)
  {
   alert(divs[i].innerHTML);
  }
 }
&lt;/script&gt;
&lt;/HEAD&gt;</pre>
<pre class="code">&lt;BODY&gt;
 &lt;div id="myDiv"&gt;
  &lt;p&gt;This is a paragraph&lt;/p&gt;
 &lt;/div&gt;
 &lt;div id="myOtherDiv"&gt;
  &lt;p&gt;This is another paragraph&lt;/p&gt;
 &lt;/div&gt;</pre>
<pre class="code"> &lt;input type="button" value=Test1 onclick="test1();"&gt;&lt;br&gt;
 &lt;input type="button" value=Test2 onclick="test2();"&gt;&lt;br&gt;</pre>
<pre class="code">&lt;/BODY&gt;
&lt;/HTML&gt;</pre>
</div>
</pre>
<p>이 함수의 다른 좋은 점은 이것은 인자형태를 가질수 있는 다른 함수를 생성할때 매우 유용하도록 만들어주는 id문자열이나 요소객체 자체를 던질수 있다는 것이다.</p>
<p><!-- ------------------------------------------------------------------------------------------- --></p>
<h4><span class="functionName">$F()</span> 함수 사용하기</h4>
<p><span class="code">$F()</span> 함수는 다른 단축키이다. 이것은 text박스나 드랍다운 list와 같은 어떤 필드의 입력 컨트롤의 값을 반환한다. 이 함수는 요소 id나 요소객체 자체를 인자로 가질수 있다.</p>
<pre class="code">
<div style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; PADDING-TOP: 10px; BACKGROUND-COLOR: #e4e4e4">&lt;script&gt;
 function test3()
 {
  alert(  $F('userName')  );
 }
&lt;/script&gt;</div>
<div style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; PADDING-TOP: 10px; BACKGROUND-COLOR: #e4e4e4">&lt;input type="text" id="userName" value="Joe Doe"&gt;&lt;br&gt;
&lt;input type="button" value=Test3 onclick="test3();"&gt;&lt;br&gt;</div>
</pre>
<p><!-- ------------------------------------------------------------------------------------------- --></p>
<h4><span class="functionName">$A()</span> 함수 사용하기</h4>
<p><span class="code">$A()</span> 함수는 이것을 받아들이는 하나의 인자를 <span class="code">Array</span>객체로 변환한다.</p>
<p><a href="http://openframework.or.kr/framework_reference/prototype_js/1.4.0/prototype.js.html#Reference.Array">Array 클래스를 위한 확장</a>과 조합된 이 함수는 이것을 더욱 쉽게 만든다. 예를 들면, 작성한 함수는 인자의 수를 유연하게 받아들인다.</p>
<pre class="code">
<div style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; PADDING-TOP: 10px; BACKGROUND-COLOR: #e4e4e4">&lt;script&gt;</div>
<div style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; PADDING-TOP: 10px; BACKGROUND-COLOR: #e4e4e4"> function showOptions(){
  var someNodeList = $('lstEmployees').getElementsByTagName('option');
  var nodes = $A(someNodeList);</div>
<div style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; PADDING-TOP: 10px; BACKGROUND-COLOR: #e4e4e4">  nodes.each(function(node){
    alert(node.nodeName + ': ' + node.innerHTML);
   });
 }
&lt;/script&gt;</div>
<div style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; PADDING-TOP: 10px; BACKGROUND-COLOR: #e4e4e4">&lt;select id="lstEmployees" size="10" &gt;
 &lt;option value="5"&gt;Buchanan, Steven&lt;/option&gt;
 &lt;option value="8"&gt;Callahan, Laura&lt;/option&gt;
 &lt;option value="1"&gt;Davolio, Nancy&lt;/option&gt;
&lt;/select&gt;</div>
<div style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; PADDING-TOP: 10px; BACKGROUND-COLOR: #e4e4e4">&lt;input type="button" value="Show the options" onclick="showOptions();" &gt;</div>
</pre>
<p><!-- ------------------------------------------------------------------------------------------- --></p>
<h4><span class="functionName">$H()</span> 함수 사용하기</h4>
<p><span class="code">$H()</span> 함수는 결합된 배열을 열거할수 있는 <a href="http://openframework.or.kr/framework_reference/prototype_js/1.4.0/prototype.js.html#Reference.Hash">Hash</a>객체로 변환한다.</p>
<pre class="code">
<div style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; PADDING-TOP: 10px; BACKGROUND-COLOR: #e4e4e4">&lt;script&gt;
 function testHash()
 {
  //let's create the object
  var a = {
   first: 10,
   second: 20,
   third: 30
   };</div>
<div style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; PADDING-TOP: 10px; BACKGROUND-COLOR: #e4e4e4">  //now transform it into a hash
  var h = $H(a);
  alert(h.toQueryString()); //displays: first=10&amp;second=20&amp;third=30
 }</div>
<div style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; PADDING-TOP: 10px; BACKGROUND-COLOR: #e4e4e4">&lt;/script&gt;</div>
</pre>
<p><!-- ------------------------------------------------------------------------------------------- --></p>
<h4><span class="functionName">$R()</span> 함수 사용하기</h4>
<p><span class="code">$R()</span> 함수는 <span class="code">new ObjectRange(lowerBound, upperBound, excludeBounds)</span>를 작성하기 위한 짧은 형태이다.</p>
<p>이 클래스의 완전한 설명을 보기 위해 <a href="http://openframework.or.kr/framework_reference/prototype_js/1.4.0/prototype.js.html#Reference.ObjectRange">ObjectRange</a> 클래스 문서를 보라. <span class="code">each</span> 메소드를 통해 반복(iterators)의 사용법을 보여주는 간단한 예제를 보자. 더 많은 메소드는 <a href="http://openframework.or.kr/framework_reference/prototype_js/1.4.0/prototype.js.html#Reference.Enumerable">Enumerable</a> 클래스 문서에서 볼수 있을것이다.</p>
<pre class="code">
<div style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; PADDING-TOP: 10px; BACKGROUND-COLOR: #e4e4e4">&lt;script&gt;
 function demoDollar_R(){
  var range = $R(10, 20, false);
  range.each(function(value, index){
   alert(value);
  });
 }</div>
<div style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; PADDING-TOP: 10px; BACKGROUND-COLOR: #e4e4e4">&lt;/script&gt;</div>
<div style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; PADDING-TOP: 10px; BACKGROUND-COLOR: #e4e4e4">&lt;input type="button" value="Sample Count" onclick="demoDollar_R();" &gt;</div>
</pre>
<p><!-- ------------------------------------------------------------------------------------------- --></p>
<h4><span class="functionName">Try.these()</span> 함수 사용하기</h4>
<p>이것은 인자처럼 많은 수의 함수를 가지고 그것들을 순서대로 차례차례 호출하도록 해준다. 이것은 함수중에 하나씩 수행하고 성공적인 함수호출의 결과를 반환할때까지 순차적으로 수행된다.</p>
<p>예제는 아래와 같다. <span class="code">xmlNode.text</span>는 몇몇 브라우저에서 작동하고 <span class="code">xmlNode.textContent</span>는 다른 브라우저에서 작동한다. <span class="code">Try.these()</span>함수를 사용하면 당신은 작동하는 것중 하나를 반환할수 있다.</p>
<pre class="code">
<div style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; PADDING-TOP: 10px; BACKGROUND-COLOR: #e4e4e4">&lt;script&gt;
function getXmlNodeValue(xmlNode){
 return Try.these(
  function() {return xmlNode.text;},
  function() {return xmlNode.textContent;}
  );
}
&lt;/script&gt;</div>
</pre>
<p>예제 : <a href="http://overflow.berrybox.com/ajax/test/index.html">http://overflow.berrybox.com/ajax/test/index.html</a><br />
출처 : <a href="http://openframework.or.kr/framework_reference/prototype_js/1.4.0/prototype.js.html">http://openframework.or.kr/framework_reference/prototype_js/1.4.0/prototype.js.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://overfloweb.com/blog/index.php/archives/5/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

