Re: evalScripts and AJAX forms

2011-01-25 Thread cricket
On Tue, Jan 25, 2011 at 5:17 AM, Rory  wrote:
>
> I can't remember if JS has always come back in CDATA tags because like
> I said, it was working at one point, which would indicate JS wasn't
> coming back within CDATA tags.

If you can't remember whether it was wrapped in CDATA, the fact that
it's not now working does not indicate that CDATA has anything to do
with it.

>> I've used the Web Inspector tool in Safari to inspect the HTML view
>> being returned by the $ajax->link and the appropriate JavaScript is
>> there, however when loaded into the page, the JavaScript is stripped.
>> I thought it may be something to do with prototype's evalScripts
>> stripping the JavaScript from the returned view, however even when I
>> turn it off, the JavaScript isn't included.

Setting it to false will guarantee that it will not work.

I gave up on Prototype a long time ago, so I'm not sure what to
suggest. But, evalScripts is an option for Ajax.Updater. There's also
a more general Ajax option, evalJS:
http://www.prototypejs.org/api/ajax/options

Can you see which Content-type header is being returned?

Without seeing any code, though, it's difficult to suggest anything else.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: evalScripts and AJAX forms

2011-01-25 Thread Rory
Okay, I think I've found out why it isn't working - the Javascript in
the Ajax response is coming through surrounded in CDATA tags, which is
why it's getting stripped.

I can't remember if JS has always come back in CDATA tags because like
I said, it was working at one point, which would indicate JS wasn't
coming back within CDATA tags.

R

On Jan 24, 11:58 am, Rory  wrote:
> I've recently stumbled across a major problem which has brought the
> development of my application to a complete stand still.
>
> Basically, the way the application has been working up until now, is a
> view would be loaded into a div tag via AJAX. This view would contain
> an AJAX form which when submitted updates a status div with the
> returned AJAX content. This was working fine until a few days ago when
> it just simply stopped working.
>
> The views still load via AJAX ($ajax->link) but the submission of the
> forms via AJAX does not work.
>
> I've used the Web Inspector tool in Safari to inspect the HTML view
> being returned by the $ajax->link and the appropriate JavaScript is
> there, however when loaded into the page, the JavaScript is stripped.
> I thought it may be something to do with prototype's evalScripts
> stripping the JavaScript from the returned view, however even when I
> turn it off, the JavaScript isn't included.
>
> The strangest part of the whole puzzle is that I've literally done
> nothing that I can think of that would universally stop all forms from
> working. I could understand if it wasn't working for a single form -
> but not all of them simultaneously.
>
> Anyone got any ideas, because I'm totally stumped.
>
> Thanks,
> Rory

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php