javascript - When does Dojo need the args variable? -


You have to pass the Argus variable on the anonymous function, but the anonymous function does not require the ARGS variable, so when you Elggs are required, but Dojo does not say the help page! So, why doozjes need ElGs variable?

  var init = function () {var contentNode = dojo.byId ("content"); Dojo.xhrGet ({url: "js / sample.txt", handleAs: "text", load: function (data, args) {//. We can fade nodes, we are modifying dojo.fadeOut ( {Node: contentNode, onend: Function () {// set data, feed it back into content.Node.innerHTML = data; dojo.fadeIn ({node: contentNode}} play ();}}). ();}, // If there is an error, it goes here: error: function (error, args) {console.warn ("error!", Error);}}); }; Dojo.addOnLoad (init);  

To clarify: You are referring to the argument "args" in your code The sample that is a part of the function definitions for "load}" and "error" callback is:

You only need the ElGs variable if you have to use it. Dojo does not have its own need. Usually you do not want it to be needed. The first argument you should be of the result for which you are searching for.

However, if you need access to the raw XMLHttpRequest object, then args.x will hold it.

Similarly, if you want to access the original object that you reach dojo.xhrGet () then you can get it at args.args (for this reason, I usually use that logic The name ioArgs say, therefore it may be ioArgs.args).


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -