<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Rails Forum - Ruby on Rails Help and Discussion Forum - How do I pass a variable to this js???]]></title>
		<link>http://railsforum.com/viewtopic.php?id=42720</link>
		<description><![CDATA[The most recent posts in How do I pass a variable to this js???.]]></description>
		<lastBuildDate>Wed, 02 Feb 2011 10:02:39 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: How do I pass a variable to this js???]]></title>
			<link>http://railsforum.com/viewtopic.php?pid=136574#p136574</link>
			<description><![CDATA[<p>consider $() as getElementById;<br />$() return an Element object. You&#039;re trying to add string to an Element object. Does it have sense?</p><p>If your var &quot;model&quot; is a string that represent some html id, just do this:</p><div class="codebox"><pre><code>function gmap_update_position(model) {
  var lat = $(model + &quot;lat&quot;);
  var lon = $(model + &quot;lon&quot;);

  // ....
}</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (Mulasse)]]></author>
			<pubDate>Wed, 02 Feb 2011 10:02:39 +0000</pubDate>
			<guid>http://railsforum.com/viewtopic.php?pid=136574#p136574</guid>
		</item>
		<item>
			<title><![CDATA[How do I pass a variable to this js???]]></title>
			<link>http://railsforum.com/viewtopic.php?pid=136559#p136559</link>
			<description><![CDATA[<p>So here is my code that I have so far. It doesn&#039;t work... :</p><div class="codebox"><pre><code>  function gmap_update_position(model){
    lat = document.getElementById($(model)+&quot;lat&quot;);
    lon = document.getElementById($(model)+&quot;lon&quot;);
    lat.value = &quot;&quot;+ marker.getPoint().lat();
    lon.value = &quot;&quot;+ marker.getPoint().lng();
  }</code></pre></div><p>I want to pass the &#039;model&#039;&nbsp; variable to the &#039;getElementById&#039;. It should read:&nbsp; getElementById(&quot;model_lat&quot;);</p><p>However replacing the model with whatever the variable is.</p><p>I am useless at Js, any help would be greatly appreciated!</p>]]></description>
			<author><![CDATA[dummy@example.com (temullen)]]></author>
			<pubDate>Tue, 01 Feb 2011 21:31:26 +0000</pubDate>
			<guid>http://railsforum.com/viewtopic.php?pid=136559#p136559</guid>
		</item>
	</channel>
</rss>
