JavaScript编译时Uncaught TypeError: undefined is not a function

Leedoy 2014-06-25 11:45:24
JavaScript编译时Chrome报告Uncaught TypeError: undefined is not a function错误
...全文
47350 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
竹凌居士 2016-05-16
  • 打赏
  • 举报
回复
你好,我也是遇到。。。is not a function 但是都已经定义了
var chartInc = new Chart2D(this.div);

chartInc.addAxis("x",{labels: [{ value: 1, text: "美食" },
{ value: 2, text: "饮料,奶茶" },
{ value: 3, text: "装饰" },
{ value: 4, text: "婚庆" },
{ value: 5, text: "医药" },
{ value:6, text: "茶座" },
{ value:7, text: "美容" },
{ value:8, text: "娱乐中心" }],
majorTick: { length: 0 },
minorTick: { length: 0 },
natural: true
});
维秀斯丢丢 2016-01-15
  • 打赏
  • 举报
回复
ArcGis吗
Leedoy 2014-06-25
  • 打赏
  • 举报
回复
解决了,在stopsGraphicsLayer.add(stopPoint); 前面需要重新定义一下stopsGraphicsLayer,即stopsGraphicsLayer=new esri.layers.GraphicLayer();重要的是GraphicLayer()前一定要添加esri.layers. 在这里还是感谢大家
Leedoy 2014-06-25
  • 打赏
  • 举报
回复
刚才研究了一下,应该是 stopsGraphicsLayer.add(stopPoint); 这句有问题,不过stop函数是GraphicLayer变量里的内置函数,这怎么解决啊?
自然框架 2014-06-25
  • 打赏
  • 举报
回复
要么函数名写错了,要么没有引用js文件。要么定义晚了。
Leedoy 2014-06-25
  • 打赏
  • 举报
回复
变量方法都是定义好的呀,下面是部分代码: function mapClickHandler(evt) { var stopP = new Point(evt.mapPoint.x, evt.mapPoint.y, myMap.spatialReference); var stopPoint = new esri.Graphic(stopP); stopsGraphicsLayer.add(stopPoint); stops.features.push(stopPoint); } 它这意思是哪个函数或变量未定义啊?
island__ 2014-06-25
  • 打赏
  • 举报
回复
调用方法的变量未定义
学学你们 2014-06-25
  • 打赏
  • 举报
回复
调用了无效的方法

87,910

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧