My Exec Method

Source: Internet
Author: User
Function Exec (funcName, arr, byResult ){
If (byResult ){
If (typeof funcName = "string "){
If (window [funcName]) {
// If false is returned or no return value is returned, the execution will continue once, knowing that true is returned.
If (! Window [funcName] (arr )){
Window. setTimeout (function () {Exec (funcName, arr, true)}, _ interval );
}
}
Else {
Window. setTimeout (function () {Exec (funcName, arr, true)}, _ interval );
}
} Else {
If (! FuncName (arr )){
Window. setTimeout (function () {Exec (funcName, arr, true)}, _ interval );
}
}
} Else {
If (typeof funcName = "string "){
// If this function has been loaded
If (window [funcName]) {
Window [funcName] (arr );
} // If the function is not loaded, check every 0.1 seconds until the loading is complete.
Else {
Window. setTimeout (function () {Exec (funcName, arr)}, _ interval );
}
} Else {
FuncName (arr );
}
}
}

Function Exec2 (funcName, arr, byResult ){
If (typeof funcName = "string "){
If (window [funcName]) {
If (byResult ){
If (! Window [funcName] (arr )){
Window. setTimeout (function () {Exec (funcName, arr, true)}, _ interval );
}
} Else {
Window [funcName] (arr );
}
}
Else {
Window. setTimeout (function () {Exec (funcName, arr, byResult)}, _ interval );
}
} Else {
If (byResult ){
If (! FuncName (arr )){
Window. setTimeout (function () {Exec (funcName, arr, true)}, _ interval );
}
} Else {
FuncName (arr );
}
}
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.