简体   繁体   中英

Looping through array of functions - Object doesn't support this property or method (IE8)

I'm trying to loop through array of functions and execute all of them. Here's my code-

for(var x=0;x<myFunctions.length;x++) {
    myFunctions[x]();
}

it works without any error/warning on other browsers but IE(8) throws this warning:

Object doesn't support this property or method

The function does execute and everything goes fine. Can someone explain what might be causing this error?

note: the error persist regardless of what's in the function that's being executed, i tried running a blank function even

It would be great if you could share a function example. You might get an error within the function itself, use the debug tool (at the browser usually f12) an go line by line.

BTW Read about 'call' and 'apply' as to how to execute javascript functions.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM