dojox/io/xhrScriptPlugin.js

  • Provides:

    • dojox.io.xhrScriptPlugin
  • Requires:

    • dojox.io.xhrPlugins in common
    • dojo.io.script in common in project dojo
    • dojox.io.scriptFrame in common
  • dojox.io.xhrScriptPlugin

    • type
      Function
    • parameters:
      • url: (typeof String)
        Url prefix of the site which can handle JSONP requests.
      • callbackParamName: (typeof String)
      • httpAdapter: (typeof Function)
        This allows for adapting HTTP requests that could not otherwise be
        sent with JSONP, so you can use a convention for headers and PUT/DELETE methods.
    • source: [view]
       dojox.io.xhrPlugins.register(
        "script",
        function(method,args){
          return args.sync !== true &&
          (method == "GET" || httpAdapter) &&
          (args.url.substring(0,url.length) == url);
        },
        function(method,args,hasBody){
         var send = function(){
          args.callbackParamName = callbackParamName;
          if(dojo.body()){
           args.frameDoc = "frame" + Math.random();
          }
          return dojo.io.script.get(args);
         }
         return (httpAdapter ? httpAdapter(send, true) : send)(method, args, hasBody); // use the JSONP transport
        }
       );
    • summary
      Adds the script transport (JSONP) as an XHR plugin for the given site. See
      dojox.io.script for more information on the transport. Note, that JSONP
      is *not* a secure transport, by loading data from a third-party site using JSONP
      the site has full access to your JavaScript environment.
    • returns
      use the JSONP transport
  • dojox.io

    • type
      Object
    • summary
  • dojox

    • type
      Object
    • summary