开发者

object[index] - Javascript Object Error in IE - Object doesn't support this property or method

开发者 https://www.devze.com 2023-01-15 14:42 出处:网络
I have a simple script to retrieve an id from an object list in javascript.Here is the example: var element_id;

I have a simple script to retrieve an id from an object list in javascript. Here is the example:

   var element_id;

    if (cur_index !== 0) {
        element_id = _BIG_LIST[cur_index-1];
    }
开发者_运维知识库

IE is throwing an error at: _BIG_LIST[cur_index-1]

Error is Object doesn't support this property or method. This works fine in other browsers, and _BIG_LIST is definitely populated. Also cur_index is definitely within the _BIG_LIST object.

Any ideas?


This was fixed. The var element_id was not in scope where i was using it, which caused IE to throw the error.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号