The evalScripts option is used by Ajax.Updater to evaluate the scripts in an
Ajax request before updating an element.  Ajax.Request (which is what
form.request() boils down to) doesn't do any evaluation or updating for you,
you have to do it yourself.  In the body of your handler, you will have to
do something like the following:

function submit_update(response) {
  response.responseText.evalScripts();
}

Or, better, just to be safe if you have long-running scripts:

function submit_update(response) {
  var body = response.responseText;
  body.evalScripts.bind(body).defer();
}

-Fred

On Tue, Jun 10, 2008 at 7:51 AM, [EMAIL PROTECTED] <
[EMAIL PROTECTED]> wrote:

>
> Hi,
>
> I am having trouble with evaluation of submitted form. I do this:
>
> <input type="button" value="click me" onclick="javascript:
>  $('myform').request({
>                method: 'post',
>                onComplete: submit_update
>  });">
>
> The form is submitted properly and submit_update function is called
> upon completion. The thing is that the returned html code contains
> javascripts which should be evaluated and I simply can't force
> prototype to do this. I tried evalScripts: true but it doesn't work.
> Any ideas? Thanks.
> >
>


-- 
Science answers questions; philosophy questions answers.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to rubyonrails-spinoffs@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to