<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Rails Forum - Ruby on Rails Help and Discussion Forum - Run a function after page load -- but not from <body> tag]]></title>
		<link>http://railsforum.com/viewtopic.php?id=3393</link>
		<description><![CDATA[The most recent posts in Run a function after page load -- but not from <body> tag.]]></description>
		<lastBuildDate>Thu, 06 Jan 2011 11:03:10 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Run a function after page load -- but not from <body> tag]]></title>
			<link>http://railsforum.com/viewtopic.php?pid=135426#p135426</link>
			<description><![CDATA[<p>With prototype:</p><div class="codebox"><pre><code>$(document).observe(&#039;dom:ready&#039;, function(){
  //your function call here
});</code></pre></div><p>With jQuery:</p><div class="codebox"><pre><code>$(document).ready(function(){
  //your function call here
});</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (Mulasse)]]></author>
			<pubDate>Thu, 06 Jan 2011 11:03:10 +0000</pubDate>
			<guid>http://railsforum.com/viewtopic.php?pid=135426#p135426</guid>
		</item>
		<item>
			<title><![CDATA[Re: Run a function after page load -- but not from <body> tag]]></title>
			<link>http://railsforum.com/viewtopic.php?pid=134803#p134803</link>
			<description><![CDATA[<p>I know this post is old, but this is a great post to bookmark for different ways to execute javascript or jquery on the load of a webpage: <a href="http://webdeveloperpost.com/Articles/Ways-to-fire-jQuery-and-javascript-code-when-the-page-loads.aspx">http://webdeveloperpost.com/Articles/Wa &#133; loads.aspx</a></p>]]></description>
			<author><![CDATA[dummy@example.com (ricketts)]]></author>
			<pubDate>Thu, 23 Dec 2010 04:27:48 +0000</pubDate>
			<guid>http://railsforum.com/viewtopic.php?pid=134803#p134803</guid>
		</item>
		<item>
			<title><![CDATA[Re: Run a function after page load -- but not from <body> tag]]></title>
			<link>http://railsforum.com/viewtopic.php?pid=19439#p19439</link>
			<description><![CDATA[<p>Hmm... interesting.</p><p>Actually, it seems that prototype can deal with this sort of thing in a nice way.&nbsp; See the following documentation: <a href="http://www.prototypejs.org/api/event/observe">http://www.prototypejs.org/api/event/observe</a></p>]]></description>
			<author><![CDATA[dummy@example.com (Slurpy)]]></author>
			<pubDate>Thu, 05 Apr 2007 19:40:28 +0000</pubDate>
			<guid>http://railsforum.com/viewtopic.php?pid=19439#p19439</guid>
		</item>
		<item>
			<title><![CDATA[Re: Run a function after page load -- but not from <body> tag]]></title>
			<link>http://railsforum.com/viewtopic.php?pid=19432#p19432</link>
			<description><![CDATA[<p>You might try sticking the JavaScript code you want to run in a Controller variable (like @js_function_call), then expand that variable inside the &lt;div&gt; using a Ruby snippet, like this:</p><p>&lt;div id=&quot;chatbox&quot; &lt;%= @js_function_call %&gt; ... &lt;/div&gt;</p><p>Let me know if that works - it might come in handy elsewhere!&nbsp; Good luck.</p>]]></description>
			<author><![CDATA[dummy@example.com (bobobi)]]></author>
			<pubDate>Thu, 05 Apr 2007 19:15:14 +0000</pubDate>
			<guid>http://railsforum.com/viewtopic.php?pid=19432#p19432</guid>
		</item>
		<item>
			<title><![CDATA[Run a function after page load -- but not from <body> tag]]></title>
			<link>http://railsforum.com/viewtopic.php?pid=14582#p14582</link>
			<description><![CDATA[<p>I&#039;m playing around with my own cheap version of an ajax chat system.&nbsp; </p><p>To start getting chat events, I need to call a javascript function just one time.&nbsp; I&#039;m currently using &lt;body onload = &quot;...&quot;&gt;.&nbsp; Which is not a great place for this, because I won&#039;t know which parts of the website really will need to call that function -- only the ones that have a chat box, should make a call to this function.</p><p>So, really, I&#039;d like to stick a call to the function into the div that will do the chatter reporting.&nbsp; How should I do this?</p><p>So I want it in here:</p><p>&lt;div id=&quot;chatbox&quot;&gt;...&lt;/div&gt;</p><p>and not in the &lt;body&gt; tag.</p><p>Thoughts?</p>]]></description>
			<author><![CDATA[dummy@example.com (Slurpy)]]></author>
			<pubDate>Mon, 26 Feb 2007 00:18:07 +0000</pubDate>
			<guid>http://railsforum.com/viewtopic.php?pid=14582#p14582</guid>
		</item>
	</channel>
</rss>
