【发布时间】:2015-10-25 03:34:30
【问题描述】:
我尝试运行快速启动链接 (Quick Start) 中提到的示例。通过 Git 中心下载所有文件。尝试运行快速入门中提到的示例时,出现以下错误“无法读取 null 的属性 'insertBefore' - handsontable.full.js:3714”。请帮我运行基本示例。
使用的版本 - v0.16.1
代码:
<!DOCTYPE html>
<html>
<head>
<script src="dist/handsontable.full.js"></script>
<link rel="stylesheet" media="screen" href="dist/handsontable.full.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script>
var data = [
["", "Ford", "Volvo", "Toyota", "Honda"],
["2014", 10, 11, 12, 13],
["2015", 20, 11, 14, 13],
["2016", 30, 15, 12, 13]
];
var container = document.getElementById('example');
var hot = new Handsontable(container, {
data: data,
minSpareRows: 1,
rowHeaders: true,
colHeaders: true,
contextMenu: true
});
</script>
<style>
body {
background-color: white;
margin: 20px;
}
h2 {
margin: 20px 0;
}
</style>
</head>
<body>
<h2>Default Handsontable Demo</h2>
<div id="example"></div>
</body>
【问题讨论】:
-
@ZekeDroid 的回答帮助我解决了这个问题。抱歉回复晚了。
标签: javascript html handsontable