dojo/rpc/JsonpService.js

  • Provides:

    • dojo.rpc.JsonpService
  • dojo.rpc.JsonpService

    • type
      Function
    • chains:
      • dojo.rpc.RpcService: (prototype)
      • dojo.rpc.RpcService: (call)
    • summary
      Generic JSONP service.  Minimally extends RpcService to allow
      easy definition of nearly any JSONP style service. Example
      SMD files exist in dojox.data
    • parameters:
      • args: (typeof )
      • requiredArgs: (typeof )
    • source: [view]
        if(this.required) {
         if(requiredArgs){
          dojo.mixin(this.required, requiredArgs);
         }


         dojo.forEach(this.required, function(req){
          if(req=="" || req==undefined){
           throw new Error("Required Service Argument not found: "+req);
          }
         });
        }
  • dojo.rpc.JsonpService.strictArgChecks

    • summary
  • dojo.rpc.JsonpService.bind

    • type
      Function
    • parameters:
      • method: (typeof string)
        The name of the method we are calling
      • parameters: (typeof array)
        The parameters we are passing off to the method
      • deferredRequestHandler: (typeof deferred)
        The Deferred object for this particular request
      • url: (typeof )
    • source: [view]
        var def = dojo.io.script.get({
         url: url||this.serviceUrl,
         callbackParamName: this.callbackParamName||"callback",
         content: this.createRequest(parameters),
         timeout: this.timeout,
         handleAs: "json",
         preventCache: true
        });
        def.addCallbacks(this.resultCallback(deferredRequestHandler), this.errorCallback(deferredRequestHandler));
    • summary
      JSONP bind method. Takes remote method, parameters,
      deferred, and a url, calls createRequest to make a JSON-RPC
      envelope and passes that off with bind.
  • dojo.rpc.JsonpService.createRequest

    • type
      Function
    • parameters:
      • parameters: (typeof )
    • source: [view]
        var params = (dojo.isArrayLike(parameters) && parameters.length==1) ?
          parameters[0] : {};
        dojo.mixin(params,this.required);
        return params;
    • summary
      create a JSONP req
      params: array
      The array of parameters for this request;
  • this.required

    • mixins:
      • requiredArgs: (normal)
    • summary
  • params

    • mixins:
      • this.required: (normal)
    • summary
  • dojo.rpc

    • type
      Object
    • summary
  • dojo

    • type
      Object
    • summary