ITPub博客

首页 > 应用开发 > > 为什么一直报错这个这段代码

为什么一直报错这个这段代码

作者:smanzheng 时间:2019-10-08 15:04:27 0 删除 编辑

Uncaught TypeError: gameDiv.push is not a function at initDiv ?

为什么一直报错这个这段代码  这是我的源码

var initDiv = function(container, data, divs){

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

var div = [];

for(var j = 0; j <data[0].length; j++){

var newNode = document.createElement('div');

newNode.className = 'none';

newNode.style.top = (i*20) + 'px';

newNode.style.left = (j*20) + 'px';

container.appendChild(newNode);

gameDiv.push(newNode);

}

divs.push(gameDiv);

}

}

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/4759/viewspace-3149770/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: direct2d c++
请登录后发表评论 登录
全部评论

注册时间:2019-04-25

  • 博文量
    115
  • 访问量
    1241