# Remote\_function's JS output will not execute

**URL:** <https://www.ruby-forum.com/t/remote-functions-js-output-will-not-execute/147813>\
**Category:** Rails\
**Created:** [September 5, 2008, 4:46pm UTC](https://www.ruby-forum.com/t/remote-functions-js-output-will-not-execute/147813 "2008-09-05T16:46:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![temesta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e9bcb4/32.png) [@temesta](https://www.ruby-forum.com/u/temesta)\
**Post date:** [September 5, 2008, 4:46pm UTC](https://www.ruby-forum.com/t/remote-functions-js-output-will-not-execute/147813/1 "2008-09-05T16:46:24Z")

</div>

Hi,

this is weird. I’m calling this line and firebug is complaining about:  
‘invalid assignment left-hand side’

```
      <%= javascript_tag(remote_function(:url

```

=\>ctemplates\_path(),:with=\>‘resulttarget=sidebar\_templateresult&templatetype=template&reslayout=sidebar’,:method  
=\>‘get’,:loading=\>update\_page { |page| page.show spinnerdiv  
},:complete=\>update\_page { |page| page.hide spinnerdiv }) ) -%\>

This is the generated javascript:

What am I doing wrong?

Greete

---

<div class="post-metadata">

**Author:** ![temesta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e9bcb4/32.png) [@temesta](https://www.ruby-forum.com/u/temesta)\
**Post date:** [September 5, 2008, 4:56pm UTC](https://www.ruby-forum.com/t/remote-functions-js-output-will-not-execute/147813/2 "2008-09-05T16:56:04Z")

</div>

On 5 Sep 2008, at 15:46, Maarten P. wrote:

> # (),:with
> 
> > 
> 
> # 'resulttarget
> 
> sidebar\_templateresult  
> &templatetype=template&reslayout=sidebar’,:method  
> =\>‘get’,:loading=\>update\_page { |page| page.show spinnerdiv  
> },:complete=\>update\_page { |page| page.hide spinnerdiv }) ) -%\>

your :with option is wrong - it needs to be a javascript fragment,  
eg :with =\> “‘resulttarget=sidebar\_templateresult’”  
Note the extra quote marks.

Fred

---

<div class="post-metadata">

**Author:** ![temesta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e9bcb4/32.png) [@temesta](https://www.ruby-forum.com/u/temesta)\
**Post date:** [September 5, 2008, 4:58pm UTC](https://www.ruby-forum.com/t/remote-functions-js-output-will-not-execute/147813/3 "2008-09-05T16:58:19Z")

</div>

Thanks Frederick !  
I just figured it out myself 🙂 … Anyway, I hope this also helps other  
people
