What about something like:

Request.JSON.ASP = new Class({
    Extends: Request.JSON,
    
    onSuccess: function(json, text) {
        if (json.d) json = json.d;
        this.parent(json, text);
    }
    
});

And then you can just use Request.JSON.ASP wherever you would use Request.JSON, 
and it should just extract the "d" value transparently. 

(Although this hasn't been tested)

(Also on  http://jsfiddle.net/azyD6/ )

Michal.


On 16 May 2010, at 15:58, Midhat wrote:

> Hi
> 
> I have some mootools ajax code that now needs to work with ASP.Net 2.0
> and 3.5 framework web services. The framework 3.5 WSs wrap returned
> arrays in a 'd' object while 2.0 services dont. To counter this,
> jQuery has a dataFilter parameter to its jQuery.ajax function (http://
> encosia.com/2009/06/29/never-worry-about-asp-net-ajaxs-d-again/).
> 
> Is there any such feature in mootools. If there isnt and I have to
> roll my own. Where should I start

Reply via email to