Assigning the variable inside script block as the properties of window
solved my problem. Trust me this information is quite hardly found. Took me
a whole day. You're the man !!!
On Thursday, March 22, 2012 8:19:51 PM UTC+5:45, Brian Marquis wrote:
>
> change your script to:
>
>
> window.sayHi
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 Develo
change your script to:
window.sayHi = function() {
alert("Hi");
}
Likewise, any variables defined in the script block are not evaluated in the
global scope, therefore, they need to be assigned as properties of window or
document. See
http://api.prototypejs.org/language/String/prototype/
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