Home > front end >  A member function inside the onload how to call another member function.
A member function inside the onload how to call another member function.

Time:03-12

The simplest explanation of the problem: : : : : : : : : : :
The function exterfun (img1, img2) {
var i;
The function corefun (I) {
$(img1). Attr (onload ""," corecorefun (I) ");
}
The function corecorefun (I) {
}
}
System to remind, however, cannot find corecorefun the function,
Onload how to invoke corecorefun inside, how to pass parameters I
Thank you,

The background is as follows:

I made a deal with img,
Circulation processing, 5 times img2list is five members of the list
Is at the core of corefun function, to the current processing independence idx, took them in img2list corresponding member,
The function exterfun (img1, img2list) {
Var div=document. The createElement method (" div ");
Document. The body. The appendChild (div);
Var independence idx=0;
Corefun (0);
The function corefun (I) {
$(div). The HTML (" ");
$(div). Append (img1);
$(div). Append (img2list [I]);
//processing pixel img1 img2 [I]
//
Time consuming process,,
//
//need to join onl oad or img blank now,
Idx++;
If (idx> 5) {
//return job.
} else {
Corefun (independence idx);
}
}

}
Code, the question is not working in the onl oad img1, so probably img1 is blank,
So I need in the img onl oad within data,

To this end, I add a corecorefun function, on the onl oad,
The function exterfun (img1, img2) {
Var div=document. The createElement method (" div ");
Document. The body. The appendChild (div);
Var independence idx=0;
Corefun (0);
The function corefun (I) {
$(div). The HTML (" ");
$(div). Append (img1);
$(div). Append (img2);
$(img1). Attr (onload ""," corecorefun (I) ");

}
The function corecorefun (I) {
//processing pixel img1 img12
//
Time consuming process,,
//

Idx++;
If (idx> 5) {
//return job.
} else {
Corefun (independence idx);
}
}
}
System to remind, however, cannot find corecorefun the function,
Is not defined, please comment, a function of the following two functions, one is the function of onl oad how to call another child function?
Thank you,
  • Related