简体   繁体   English

解析未捕获的TypeError:无法读取未定义的属性“ get”

[英]Parse Uncaught TypeError: Cannot read property 'get' of undefined

This is my code: 这是我的代码:

var images = new Parse.Query("Images");
var bunny_data = [];

images.equalTo("indexImg","T");
images.find({
    success: function(objects) {
        for(var i = 0;i<=objects.length;i++){
            var object =  objects[i];
            object.get('imgUrl');

        };
    },
    error: function(error) {
        console.log("An error occured :(");
    }
});
console.log(bunny_data);

The console is: 控制台是:

[]
myjs.js:65 Uncaught TypeError: Cannot read property 'get' of undefined myjs.js:65未捕获的TypeError:无法读取未定义的属性“ get”

for(var i = 0;i<=objects.length;i++){

The <= means this loops from 0 to objects.length inclusive, but length is an exclusive upper bound on an array's indices. <=表示此循环从0objects.length包括在内,但是length是数组索引的唯一上限。 Use < instead. 使用<代替。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 解析-未捕获的TypeError:无法读取未定义的属性“ get” - Parse - Uncaught TypeError: Cannot read property 'get' of undefined 未捕获的类型错误:无法读取未定义的属性“get” - Uncaught TypeError: Cannot read property 'get' of undefined Uncaught TypeError:需要库时无法读取未定义的属性“ parse” - Uncaught TypeError: Cannot read property 'parse' of undefined when requiring a library 未捕获的TypeError:无法读取未定义的属性“未定义” - Uncaught TypeError: Cannot read property 'undefined' of undefined 未捕获的类型错误:无法读取 VueJs 中未定义的属性“get” - Uncaught TypeError: Cannot read property 'get' of undefined in VueJs 未捕获的类型错误:无法读取未定义错误的属性“get” - Uncaught TypeError: Cannot read property 'get' of undefined error 捕获TypeError:尽管有条件,但无法读取未定义的属性“ get” - Getting Uncaught TypeError: Cannot read property 'get' of undefined in spite of the conditionals 为什么我得到 Uncaught TypeError: Cannot read property &#39;sequence&#39; of undefined - why I get Uncaught TypeError: Cannot read property 'sequence' of undefined 未捕获的TypeError:无法读取未定义的属性“数量” - Uncaught TypeError: Cannot read property 'quantity' of undefined 未捕获的TypeError:无法读取未定义的属性&#39;fromJSON&#39; - Uncaught TypeError: Cannot read property 'fromJSON' of undefined
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM