Dojo/request/script can be used to send cross-domain requests to the server, such as JSONP. But looking at official documents is a bit difficult to understand and will experience the record.
Require(["Dojo/request/script"],function(Script){Script.Get("Something.js",{Jsonp:"Callback"}).Then(function(Data) {//On_successDo something with the response data},function(Err) {//On_errorHandle the error condition});Progress Events is not supported})
Script.get (URL, option);
Where the Option field is:
Checkstring: "somestring",//The server returns a section of JS code defined a variable somestring, the browser to determine whether the variable is defined to determine whether the successful execution. On_success does not transmit data inside.
JSONP: "Cb_name",//The browser sends a field similar to Cb_name=dojo_request_script_callbacks.dojo_request_script0 to the server,
Server returnsdojo_request_script_callbacks.dojo_request_script0(...) The invocation statement is for the browser to execute, and the calling parameter is the on_success data. If you need to perform the
Call, then in the on_success inside their own manual call, why do you love.
Query: "somestring" or objcect,//The browser sends the corresponding parameter to the server, the server returns the statements are eval, but on_success does not send data.
The other two fields are TimeOut, Preventcache easy to understand.
Play with Dojo/request/script