Topic: Javascript in erb code

I am calling a Rails controller from Javascript (this example uses ExtJS):

  Ext.getCmp('content-panel').load("/charts/1");

The view returned contains Javascript and HTML/erb.  While the HTML/erb renders properly, the javascript does not execute.  If I go directly to the page I am trying to access via the browser, the javascript executes as expected.  What am I doing wrong(I know, I know, I'm a javascript newbie)?

This post details what I am trying to do.

Last edited by SethG (2009-04-29 15:11:34)

Re: Javascript in erb code

Use RJS for this, not vanilla JavaScript.