Javascript Handsontable - Uncaught TypeError: Cannot read property 'insertBefore' of undefined

Dubb

I'm using the handsontable library for creating neat tables.
I literally copied the tutorial but the console (web developer console) gives me the following error:

Uncaught TypeError: Cannot read property 'insertBefore' of undefined            
handsontable.full.js:4471 

I link both the .css and the .js file correctly in the <head> tags.

My javascript looks like this:

var data = [
    ["", "Ford", "Volvo", "Toyota", "Honda"],
    ["2016", 10, 11, 12, 13],
    ["2017", 20, 11, 14, 13],
    ["2018", 30, 15, 12, 13]
];

var container = document.getElementById('temp');
var hot = new Handsontable(container, {
    data: data,
    rowHeaders: true,
    colHeaders: true,
    dropdownMenu: true
});

Html:

<div id="temp"></div>

Line 4471 in handsontable.full.js is

rootElement.insertBefore(this.container, rootElement.firstChild);

The table isn't displayed, the error in the console is all I've got.

AndreaBogazzi

It looks like that your

document.getElementById('temp');

return undefined.

Make sure that the container element is still there when Handsontable is constructing.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Javascript Uncaught TypeError: Cannot read property of undefined

From Dev

JavaScript error: Uncaught TypeError: Cannot read property 'left' of undefined

From Dev

JavaScript error: Uncaught TypeError: Cannot read property 'remove' of undefined

From Dev

Uncaught TypeError: Cannot read property 'canvas' of undefined - Javascript Object

From Dev

Javascript Uncaught TypeError: Cannot read property '0' of undefined

From Dev

JavaScript - Uncaught TypeError: Cannot read property 'search' of undefined

From Dev

Javascript - Uncaught TypeError: Cannot read property 'value' of undefined

From Dev

Javascript and XML - Uncaught TypeError: Cannot read property 'childNodes' of undefined

From Dev

Javascript, Uncaught TypeError: Cannot read property "cells" of undefined

From Dev

Uncaught TypeError: Cannot read property 'width' of undefined in JavaScript

From Dev

javascript: Uncaught TypeError: Cannot read property 'Play' of undefined

From Dev

JavaScript - Uncaught TypeError: Cannot read property 'search' of undefined

From Dev

javascript "Uncaught TypeError: Cannot read property 'textfield' of undefined"

From Dev

Javascript: Simple Function - Uncaught TypeError: Cannot read property 'length' of undefined

From Dev

JavaScript error: Uncaught TypeError: Cannot read property 'remove' of undefined

From Dev

Electron JavaScript Uncaught TypeError: Cannot read property 'on' of undefined

From Dev

Javascript Uncaught TypeError: Cannot read property 'push' of undefined

From Dev

Uncaught TypeError: Cannot read property 'toLowerCase' of undefined

From Dev

Uncaught TypeError: Cannot read property 'substr' of undefined

From Dev

Uncaught TypeError: Cannot read property 'createRouteFromReactElement' of undefined

From Dev

Uncaught TypeError: Cannot read property 'ajax' of undefined

From Dev

Uncaught TypeError: Cannot read property 'call' of undefined

From Dev

Uncaught TypeError: Cannot read property 'createDocumentFragment' of undefined

From Dev

Uncaught TypeError: Cannot read property 'addMethod' of undefined

From Dev

Uncaught TypeError: Cannot read property 'draw' of undefined

From Java

Uncaught TypeError: Cannot read property 'top' of undefined

From Dev

Uncaught TypeError: Cannot read property 'parentNode' of undefined

From Java

Uncaught TypeError: Cannot read property 'linear' of undefined

From Dev

Uncaught TypeError: Cannot read property 'document' of undefined

Related Related

  1. 1

    Javascript Uncaught TypeError: Cannot read property of undefined

  2. 2

    JavaScript error: Uncaught TypeError: Cannot read property 'left' of undefined

  3. 3

    JavaScript error: Uncaught TypeError: Cannot read property 'remove' of undefined

  4. 4

    Uncaught TypeError: Cannot read property 'canvas' of undefined - Javascript Object

  5. 5

    Javascript Uncaught TypeError: Cannot read property '0' of undefined

  6. 6

    JavaScript - Uncaught TypeError: Cannot read property 'search' of undefined

  7. 7

    Javascript - Uncaught TypeError: Cannot read property 'value' of undefined

  8. 8

    Javascript and XML - Uncaught TypeError: Cannot read property 'childNodes' of undefined

  9. 9

    Javascript, Uncaught TypeError: Cannot read property "cells" of undefined

  10. 10

    Uncaught TypeError: Cannot read property 'width' of undefined in JavaScript

  11. 11

    javascript: Uncaught TypeError: Cannot read property 'Play' of undefined

  12. 12

    JavaScript - Uncaught TypeError: Cannot read property 'search' of undefined

  13. 13

    javascript "Uncaught TypeError: Cannot read property 'textfield' of undefined"

  14. 14

    Javascript: Simple Function - Uncaught TypeError: Cannot read property 'length' of undefined

  15. 15

    JavaScript error: Uncaught TypeError: Cannot read property 'remove' of undefined

  16. 16

    Electron JavaScript Uncaught TypeError: Cannot read property 'on' of undefined

  17. 17

    Javascript Uncaught TypeError: Cannot read property 'push' of undefined

  18. 18

    Uncaught TypeError: Cannot read property 'toLowerCase' of undefined

  19. 19

    Uncaught TypeError: Cannot read property 'substr' of undefined

  20. 20

    Uncaught TypeError: Cannot read property 'createRouteFromReactElement' of undefined

  21. 21

    Uncaught TypeError: Cannot read property 'ajax' of undefined

  22. 22

    Uncaught TypeError: Cannot read property 'call' of undefined

  23. 23

    Uncaught TypeError: Cannot read property 'createDocumentFragment' of undefined

  24. 24

    Uncaught TypeError: Cannot read property 'addMethod' of undefined

  25. 25

    Uncaught TypeError: Cannot read property 'draw' of undefined

  26. 26

    Uncaught TypeError: Cannot read property 'top' of undefined

  27. 27

    Uncaught TypeError: Cannot read property 'parentNode' of undefined

  28. 28

    Uncaught TypeError: Cannot read property 'linear' of undefined

  29. 29

    Uncaught TypeError: Cannot read property 'document' of undefined

HotTag

Archive