NEED HELP dieing here

When I try and use rjs rails just outputs the text of the javascript I
am trying to call with

javascript is enabled, I have tried setting
config.action_view.debug_rjs to false and commenting it out in the
development environment. I have created a new app with no other
javascript libraries and just tried to use rjs to call a simple
javascript function. I have the include defaults tag in the layout.

In Firebug it says

try {  } catch (e) { alert('RJS error:\n\n' +

e.toString()); alert(’ <SCRIPT type=“text/javascript”>
\nmyfunction(“pics\\test1.jpeg”);\n '); throw e }

what is this pre thing, and why won’t it just call the javascript.
This is killing me either there is some configuration everyone knows
about that isn’t posted anywhere or I haven’t come across a tutorial
that shows it or this is a bug in rails. Please help

def index
@images = Image.find(:all)
render :update do |page|
page << ’ ’
#render :index

have tried redirecting to an action with the render stuff, the page
still only has that

 thing in the body.

the layout looks like:

Your title function myfunction(src)

On Tue, Mar 4, 2008 at 11:21 AM, sweiss [email protected] wrote:

In Firebug it says

charset=UTF-8" />

Your title function myfunction(src) >

Hi sweiss

Make sure in your layout you have the script tags to load prototype.

<%= javascript_include_tag :defaults %>


On Tue, Mar 4, 2008 at 11:33 AM, sweiss [email protected] wrote:

Your title <%= yield :layout %> >

Don’t know then sorry… Is it safe to use prototype and mootools in the
same app?


I heard that it wasn’t, and the thing to make the compatible was to
replae the $ in moo tools with something else so that symbol wouldn’t
conflict, I tried that. I also created an empty app that did not have
moo tools in it, just to try and call a javascript function with rjs,
and it keeps on printiong out the text of what it should be making
call as a function.

I know prototype is being used since it parses in the try{… catch
(rjs error stuff, just don’t know why it doesn’t actually execute the

On 4 Mar 2008, at 00:21, sweiss wrote:

#render :index

You don’t need that . the thing that
parses the response knows that it’s javascript to evaluate, so you’re
asking the javascript interpreter to evaluate

which it can't since that's not legal javascript (you can see this from what firebug shows you). Remove the two page << (and make sure that when you use link_to_remote you aren't using the :update option) and you should be ok. Fred

I get the same thing, I had just coppied an old layout, the layout
looks liek this:

Your title <%= javascript_include_tag :defaults %> function myfunction(src) {}
<%= yield :layout %>