繁体   English   中英

未捕获的TypeError:r.has不是函数

[英]Uncaught TypeError: r.has is not a function

我所做的唯一更改是我升级到了新版本的handontable。 其他所有代码都相同。 在v15.1中可以正常工作,但是v16.x或17.0都给我错误。 不幸的是,我无法复制。 甚至最基本的例子对我来说都是失败的:

 document.addEventListener("DOMContentLoaded", function() { var container1 = document.getElementById('example1'); var hot1; hot1 = new Handsontable(container1, {}); }); 
 <link type="text/css" rel="stylesheet" href="http://docs.handsontable.com/0.17.0/bower_components/handsontable/dist/handsontable.full.min.css"> <script src="http://docs.handsontable.com/0.17.0/bower_components/handsontable/dist/handsontable.full.js"></script> <div id="example1"></div> 

这应该显示一个空白网格(并且在jsfiddle中也是如此),但是在我的环境中,我得到了错误。 有什么想法吗?

我不知道您在什么环境中工作,但是我能够在VisualForce中确定此错误的原因。

发生了相同的问题:Handsontable已从版本15升级到版本20,并且页面停止工作并出现类似错误:

TypeError: samples.has is not a function. 

变量样本在handsontable.full.js中初始化为:var samples = new Map(); 并且变量Map被Salesforce main.js覆盖。

我已经通过handsontable.full.js将地图替换为hotMap,并且页面正在运行。

看起来您也与环境中其他包含的js文件中的变量存在冲突。

当然我不得不更改handsontable.full.js不好,但是没有想到其他任何事情。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM