[Proto-Scripty] JavaScript from AJAX response is not being available

2012-03-22 Thread Aravinda777
Hi all, I used Prototype to get an AJAX response fromcalling a JSP page, and set it as innerHTML of a div. I tried executing eval on the response separately before going with Prototype, and seeing that prototype evaluates javascript in the reponseText, I gave it a spin. However, when I try using

Re: [Proto-Scripty] JavaScript from AJAX response is not being available

2012-03-22 Thread Walter Lee Davis
On Mar 21, 2012, at 12:11 PM, Aravinda777 wrote: Hi all, I used Prototype to get an AJAX response fromcalling a JSP page, and set it as innerHTML of a div. I tried executing eval on the response separately before going with Prototype, and seeing that prototype evaluates javascript in

RE: [Proto-Scripty] JavaScript from AJAX response is not being available

2012-03-22 Thread Brian Marquis
Also, prototype provides methods for accessing elements and content which are preferred since they are designed to account for browser differences. Specifically, $('test_div').update(reponse.responseText); See the docs on Element.update for more details. Brian Marquis | Quotepro® | Senior

[Proto-Scripty] Re: JavaScript from AJAX response is not being available

2012-03-22 Thread Aravinda777
Hi Walter, Soon after I sent this question I switched to the Ajax.Updater function and tried. But it did not work either. But, of course your comments gave me insight to some new stuff. Truly appreciate that! However, things started working once I followed the suggestions by Brian in a

[Proto-Scripty] Re: JavaScript from AJAX response is not being available

2012-03-22 Thread Aravinda777
Hi Brian, Awesome! That did the trick. Thanks for the wealth of extra knowledge you've given as well. Thanks, -A On Mar 22, 10:34 am, Brian Marquis br...@quotepro.com wrote: change your script to: script type=text/javascript window.sayHi = function() {         alert(Hi);} /script