editor icon indicating copy to clipboard operation
editor copied to clipboard

Uncaught TypeError: undefined is not a function

Open tablatronix opened this issue 10 years ago • 3 comments

using cdn with a textarea I get this error

Uncaught TypeError: undefined is not a function on t.autofocus = n == e || e.getAttribute("autofocus") != null && n == document.body

in chrome

autofocus is undefined i think

tablatronix avatar Jan 12 '15 14:01 tablatronix

bypassing that , I get Uncaught TypeError: Cannot set property 'display' of undefined e.style.display = "none";

tablatronix avatar Jan 12 '15 14:01 tablatronix

fiddle http://jsfiddle.net/tablatronix/8qvyavtv/

tablatronix avatar Jan 12 '15 15:01 tablatronix

ohh the example is wrong on the readme. You have to pass an actual dom element, not a string.

// doesnt work
new Editor({
  element: '#editor',
  tools: false
})
// correct
var editor = new Editor({
    element : $('#editor').get(0) // jquery
    element : document.getElementById('editor') // native js
});

sigh..

tablatronix avatar Jan 12 '15 15:01 tablatronix