Trying to use RJS, raw Try(my javascript) catch is displayed on page

def index
redirect_to(:action => ‘test’)
end

def test
render :update do |page|
page << ’ ’
end
end

mozilla just displayes the following, my function is defined in the
layout and my goal is just to call this javascript function when this
page is loaded, don’t know how why this won’t work, this is just basic
stuff.

try {

} catch (e) { alert(‘RJS error:\n\n’ + e.toString()); alert(’ <SCRIPT
type=“text/javascript”>\nmyfunction(“pics\\test1.jpeg”);\n </
script>’); throw e }

sweiss wrote:

def index

Did you remember to use the javascript_include tags, and do you have
javascript enabled for that particular browser…

ilan

yep javascript is enabled, and the head of my rhtml template looks
like such

Your title <%= javascript_include_tag :defaults %> <%= active_scaffold_includes %> function myfunction(src) {

On Mar 2, 9:16 pm, Ilan B. [email protected]

how is the remote method ‘test’ getting called from the view.

Do not include an :update parameter, otherwise the view is expecting a
simple render such as
render :text=>‘Replaced with this’ and wont understand the
render :update response block.

Tonypm

Hi,
have the same problem have You solved it ?
Can You post the solution

Thanks

Erhard

tonypm wrote:

how is the remote method ‘test’ getting called from the view.

Do not include an :update parameter, otherwise the view is expecting a
simple render such as
render :text=>‘Replaced with this’ and wont understand the
render :update response block.

Tonypm