These two days to try to write a ajaxtoolkit:asyncfileupload demo, it has a Onclientuploadcomplete attribute can associate client JS, so you can write onclientuploadcomplete= " Uploadcomplete, and then define the Uploadcomplete method:
Copy Code code as follows:
function Uploadcomplete (sender, E) {
Do something ...
}
But how do you get information about uploading files from E? In addition to looking at the source code of AjaxControlToolkit, you can also use JS:
Copy Code code as follows:
function Uploadcomplete (sender, E) {
var ret = "properties:\n";
For (Var prop in E) {
var val = E[prop];
if (typeof (val) = = "function") {
RET + + (prop + "()");
}
else {
RET + + prop + ":" + val;
}
ret = "; \ n";
}
alert (ret);
}
Results:
So it's clear.
Here is the use of JS "associative array" concept, JS object properties (including methods, can also be considered to be attributes) is stored in its associative array, through the for...in ... You can iterate over it.
With regard to associative arrays, we can use this:
Copy Code code as follows:
var dog = new Object ();
Dog.id = 1;
dog["name"] = "Gougou";
Alert ("ID:" + dog["id"] + ", name" + dog.name);
Get: "Id:1, Name:gougou"
This article is original, reproduced please specify: from Freeway--cnblogs