无法读取 null 的属性“insertBefore” - handsontable.full.js:3714

Pra*_*7en 2 html javascript handsontable

我尝试运行快速入门链接(快速入门)中提到的示例。通过 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>
Run Code Online (Sandbox Code Playgroud)

Zek*_*oid 7

尝试将您的 3 个脚本节点放在您的身体而不是头部。感觉就像你加载模块的方式有问题。