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 the
javascript functionality after setting the innerHTML, still it does
not seem to have got evaluated.

My sample JSP code looks like this:

<script type="text/javascript">
function sayHi(){
<input type="button" value="click" onClick="sayHi()">

I do the AJAX call like this on another page of the same app:

new Ajax.Request(page, {
                  onSuccess: function(reponse) {

When I click the button, I do not get the alert - which I can get if I
accessed the JSP dierctly. Is there something additional I need to do
to get the sayHi() function working in the target div? Or probably I
am missing something trivial altogether.

Appreciate your help on this.


You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com.
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to