Home > Web Front-end > HTML Tutorial > [Help] Please give me some guidance on what is wrong with the code below_html/css_WEB-ITnose

[Help] Please give me some guidance on what is wrong with the code below_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:16:26
Original
1076 people have browsed it

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

When running, it always prompts that the red line cannot obtain the value of the attribute "undefined", and the object is NULL or undefined.


Reply to the discussion (solution)

Sent to the wrong place

myLines row col
There is a problem with these three variables. Check if they are defined, or Is myLines[row][col] out of bounds?

What is myLines? Post the complete code
Moreover, it is best to go to the js section for this thing. .

myLines row col
There is a problem with these three variables. Check whether they are defined, or whether myLines[row][col] is out of bounds.
It is out of bounds. . . The problem has been solved, haha, thank you very much.

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template