The following code works:
new Ajax.Request('somefile.php',{
method:'get',
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();
thisclass.submit();
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 & script.aculo.us" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en.