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

def index
    redirect_to(:action => 'test')

  def test
    render :update do |page|
      page << ' <SCRIPT type="text/javascript">' 'myfunction', 'pics\test1.jpeg'
      page << ' </script>'

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

try {
<SCRIPT type="text/javascript">
} catch (e) { alert('RJS error:\n\n' + e.toString()); alert(' <SCRIPT
type=\"text/javascript\">\nmyfunction(\"pics\\\\test1.jpeg\");\n </

sweiss wrote:

def index

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


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

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-
<html xml:lang="en" xmlns="" lang="en">
  <head profile="">
    <meta http-equiv="Content-Type" content="text/html;
charset=UTF-8" />
    <title>Your title</title>
    <script type="text/javascript" src="mootools.js"></script>
    <script type="text/javascript" src="croppr.js"></script>
    <%= javascript_include_tag :defaults %>
    <%= active_scaffold_includes %>
    <link rel="stylesheet" type="text/css" href="main.css"/>
    <script type="text/javascript">
      function myfunction(src)

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.