<?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>Railstic &#187; rjs</title>
	<atom:link href="http://railstic.com/tag/rjs/feed/" rel="self" type="application/rss+xml" />
	<link>http://railstic.com</link>
	<description>sharing experiences</description>
	<lastBuildDate>Mon, 29 Aug 2011 00:31:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>How to check if a div exists in rjs?</title>
		<link>http://railstic.com/2008/08/how-to-check-if-a-div-exists-in-rjs/</link>
		<comments>http://railstic.com/2008/08/how-to-check-if-a-div-exists-in-rjs/#comments</comments>
		<pubDate>Sun, 24 Aug 2008 17:52:36 +0000</pubDate>
		<dc:creator>İ. Emre Kutlu</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[div]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[rjs]]></category>

		<guid isPermaLink="false">http://izzetemrekutlu.com/blog/?p=3</guid>
		<description><![CDATA[&#60;body&#62; &#60;div id='main'&#62; Main Div &#60;/div&#62; &#60;/body&#62; render :update do &#124;page&#124; page &#60;&#60; &#34;if ($('main')){&#34; page.replace_html 'main', :inline =&#62; 'Here it is' page &#60;&#60; &#34;}&#34; end This ruby code checks if there is a DOM object that its id = &#8220;main&#8221;. If there is then changes its content to &#8220;Here it is&#8221;, if there is [...]]]></description>
			<content:encoded><![CDATA[<p></p>

<div class="wp_codebox"><table><tr id="p1723"><td class="code" id="p172code3"><pre class="html4strict" style="font-family:monospace;">&lt;body&gt;
   &lt;div id='main'&gt;
      Main Div
   &lt;/div&gt;
&lt;/body&gt;</pre></td></tr></table></div>

<p></p>

<div class="wp_codebox"><table><tr id="p1724"><td class="code" id="p172code4"><pre class="ruby" style="font-family:monospace;">render <span style="color:#ff3333; font-weight:bold;">:update</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>page<span style="color:#006600; font-weight:bold;">|</span>
   page <span style="color:#006600; font-weight:bold;">&lt;&lt;</span> <span style="color:#996600;">&quot;if ($('main')){&quot;</span>
   page.<span style="color:#9900CC;">replace_html</span> <span style="color:#996600;">'main'</span>, <span style="color:#ff3333; font-weight:bold;">:inline</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'Here it is'</span>
   page <span style="color:#006600; font-weight:bold;">&lt;&lt;</span> <span style="color:#996600;">&quot;}&quot;</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></td></tr></table></div>

<p>This ruby code checks if there is a DOM object that its id = &#8220;main&#8221;.<br />
If there is then changes its content to &#8220;Here it is&#8221;, if there is not do nothing.</p>
]]></content:encoded>
			<wfw:commentRss>http://railstic.com/2008/08/how-to-check-if-a-div-exists-in-rjs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

