I'm trying to create a subclass of Request by Request.JSON pattern simply like below:
- Request.Novo = new Class({
- Extends: Request,
- options: {
- method: 'POST',
- evalScripts:true,
- noCache:true,
- onFailure: function(xhr) {
- if(console) {
- console.log('Request Failed. ResponseText: ' + xhr.responseText);
- if(console.dir) console.dir(xhr);
- }
- }
- },
- initialize: function(options){
- this.parent(options);
- },
- success: function(text){
- this.onSuccess(text);
- },
- hasError: function(response){
- if($type(response) == 'string')
- response = new Element('div', {html:response}).getFirst();
- if($type(response) == 'element')
- return ( $chk(response.getElement('.hasError')) ) ? true : false;
- return null;
- }
- });
It works but always returns empty responseText on onSuccess event!
Regards,
AHHP


