]>
git.wh0rd.org - tt-rss.git/blob - lib/dojo/rpc/JsonService.js
2 Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved.
3 Available via Academic Free License >= 2.1 OR the modified BSD license.
4 see: http://dojotoolkit.org/license for details
8 if(!dojo
._hasResource
["dojo.rpc.JsonService"]){
9 dojo
._hasResource
["dojo.rpc.JsonService"]=true;
10 dojo
.provide("dojo.rpc.JsonService");
11 dojo
.require("dojo.rpc.RpcService");
12 dojo
.declare("dojo.rpc.JsonService",dojo
.rpc
.RpcService
,{bustCache
:false,contentType
:"application/json-rpc",lastSubmissionId
:0,callRemote:function(_1
,_2
){
13 var _3
=new dojo
.Deferred();
16 },bind:function(_4
,_5
,_6
,_7
){
17 var _8
=dojo
.rawXhrPost({url
:_7
||this.serviceUrl
,postData
:this.createRequest(_4
,_5
),contentType
:this.contentType
,timeout
:this.timeout
,handleAs
:"json-comment-optional"});
18 _8
.addCallbacks(this.resultCallback(_6
),this.errorCallback(_6
));
19 },createRequest:function(_9
,_a
){
20 var _b
={"params":_a
,"method":_9
,"id":++this.lastSubmissionId
};
21 var _c
=dojo
.toJson(_b
);
23 },parseResults:function(_d
){
24 if(dojo
.isObject(_d
)){
31 if("ResultSet" in _d
){