The following code works:

new Ajax.Request('somefile.php',{
        onSuccess: function(transport){
                var response = transport.responseText || "no response text";
                alert("Success! \n\n" + response);
        onFailure: function(){
                alert('Something went wrong...')

however, if you encapsulate the code inside a class:

var myclass = Class.create({
        <cut and paste exact same code into here>

var thisclass = new myclass();

The code ALWAYS comes back with an empty response when you encapsulate
the AJAX call :(

Any ideas what I am doing wrong? is prototype broken?


You received this message because you are subscribed to the Google Groups 
"Prototype &" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

Reply via email to