Home  >  Article  >  Web Front-end  >  [求助]求高手指点下面的代码问题出在哪里_html/css_WEB-ITnose

[求助]求高手指点下面的代码问题出在哪里_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:16:261024browse

myMap.prototype.isCollide=function(shape_data){
for(var i=0;i var row=shape_data[i].row;
var col=shape_data[i].col;
if(col if(row==this.height) return true;
if(row else
if(this.myLines[row][col]!=NoShape)
return true;
}
return false;
}

运行的时候老是提示红色那一行无法获取属性“undefined”的值,对象为NULL或未定义。


回复讨论(解决方案)

发错地方了

myLines row  col
这三个变量有问题 检查一下是否有定义,或者myLines[row][col]是否越界了

myLines是个什么东西?代码贴全一点啊
而且,这个东西最好转到js专区去。。

myLines row  col
这三个变量有问题 检查一下是否有定义,或者myLines[row][col]是否越界了
就是越界了。。。问题已经解决了,呵呵,多谢了。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn