Hmm...I *was* able to get my above example to work, but trying
different javascript fails, so something else has to be going on.

On Jan 20, 3:53 pm, hairbo <bmuel...@gmail.com> wrote:
> Hi all,
>
> I'm not sure how to set up an Ajax test in the Mooshell, so here's
> hoping I can explain my issue here.
>
> I'm trying to submit form data using Form.Request, and then pass back
> some javascript with the HTML that gets returned.  I'd like the
> Javascript to get evaluated.  According to the Form.Request docs,
> evalScripts defaults to "true", so this basic call should get me what
> I need:
>
> var myFormSubmit = new Form.Request(
>                                 'myForm',
>                                 'myFormContainer'
>                         )
>
> The data from my form is submitted correctly, and my Ajax page returns
> this:
>
> hi there
> <script type="text/javascript">alert('hi');</script>
>
> If I look at the "Response" tab in Firebug, I see that data returned.
> However, the JS is not executed.  Furthermore, if I use "View
> Generated Source" from the Firefox plugin Web Developer, I see that
> "hi there" has been written into the DOM, but my script statement is
> nowhere to be seen.  So, it would appear that it's getting returned
> and picked up by Firebug, but then at some point after that, it
> disappears.  Here's hoping I'm doing something very stupid.
>
> Any advice is appreciated.
>
> Thanks,
> hairbo

Reply via email to