Uncaught TypeError:无法读取未定义的属性'1' [英] Uncaught TypeError: Cannot read property '1' of undefined
问题描述
loadBusesIntoMap
似乎是问题的根源。在Chrome开发人员工具上,单击错误旁边的箭头并跟踪堆栈。在运行谷歌地图代码之前,抛出错误的函数就是其中之一。很可能是某个地方发送了一个空的 bus
数组。我首先检查它是空的还是先有一个长度
...
trying to fiddle with an app, getting this error "Uncaught TypeError: Cannot read property '1' of undefined "in dev tools console. i'm pretty sure it's because of the json i'm pulling and the proxy i'm using are not talking to each other correctly. seriously n00b question, i truly don't understand what's going on in the document. i also see that there are ALOT of similar questions like this, so i'm guessing they're pretty localized and not great for the community. still important to me though...i'd like to learn what's going on in the code, not just fix the problem. you can check it out here: http://dev.bowdenweb.com/busfinder.html i did put it up on jsfiddle, but it wasn't rendering correctly. thanks for any and all advice!
loadBusesIntoMap
seems to be the root of the problem. On Chrome developer tools, click on the arrow next to the error and track the stack. Just before running Google maps code the function that throws error is that one. It's very probable that somewhere you're sending an empty buses
array. I'd start by checking if it's empty or has a length
first...
这篇关于Uncaught TypeError:无法读取未定义的属性'1'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!