# Rjs and Ajax.Updater

**URL:** <https://www.ruby-forum.com/t/rjs-and-ajax-updater/105400>\
**Category:** Rails\
**Created:** [May 29, 2007, 5:10pm UTC](https://www.ruby-forum.com/t/rjs-and-ajax-updater/105400 "2007-05-29T17:10:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![janke](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/d26b3c/32.png) [@janke](https://www.ruby-forum.com/u/janke)\
**Post date:** [May 29, 2007, 5:10pm UTC](https://www.ruby-forum.com/t/rjs-and-ajax-updater/105400/1 "2007-05-29T17:10:08Z")

</div>

I have been searching for a while now have not be able to find any type  
of list of the prototype and effects functions available to rjs. Most of  
what I have done has either come from simple examples found here and  
there or guess work(mostly the latter). Here is the problem that I am  
having

```auto
<% proj_div = "proj_div#{@project.id}" %>
<% proj_url = "/project/show_status/#{@project.id}" %>
  <li><%= link_to_function("Edit", nil, :id => "edit_ref#{@project.id}")
do |page|
          page.Ajax.Updater(proj_div, proj_url, {:asynchronous => true,
:evalScripts => true, :onComplete => "alert('it worked!');"})
    end
       %>
  </li>
```

firefox error

> [@](#):
>
> Error: this.initialize has no properties  
> Source File: [http://localhost:3001/javascripts/prototype.js?1178489268](http://localhost:3001/javascripts/prototype.js?1178489268)  
> Line: 23

selection source

```auto
<li><a href="#" id="edit_ref3484"
onclick="Ajax.Updater(&quot;proj_div3484&quot;,
&quot;/project/show_status/3484&quot;, {evalScripts: true, asynchronous:
true, onComplete: &quot;alert('it worked!');&quot;});; return
false;">Edit</a>
```

I am not really sure what I am doing wrong. This is all guess work so I  
may be way off. I know that I could just use link\_to\_remote but I plan  
on doing much more there but it all depends on being able to use the  
Ajax.Updater function. Any suggestions would be greatly appreciated

---

<div class="post-metadata">

**Author:** ![janke](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/d26b3c/32.png) [@janke](https://www.ruby-forum.com/u/janke)\
**Post date:** [May 29, 2007, 5:33pm UTC](https://www.ruby-forum.com/t/rjs-and-ajax-updater/105400/2 "2007-05-29T17:33:17Z")

</div>

I have traced the source of the problem down to the fact that the quotes  
are converted to "'s. Any suggestions as to how I can prevent that?

---

<div class="post-metadata">

**Author:** ![janke](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/d26b3c/32.png) [@janke](https://www.ruby-forum.com/u/janke)\
**Post date:** [May 31, 2007, 4:13pm UTC](https://www.ruby-forum.com/t/rjs-and-ajax-updater/105400/3 "2007-05-31T16:13:23Z")

</div>

You need to put “new” in front of your Ajax.Updater line. If you add  
that, you should get the expected result.

Hope that helps.
