0

When attempting to use this jquery plugin: http://codepen.io/bisk8s/pen/LGfBh

I am presented with this error in Console:

(index):406 Uncaught TypeError: Cannot read property 'innerHTML' of null

I believe it results from this plugin code:

function init_theme() {
  var node = document.querySelector(".colortheme");
  var colors = node.innerHTML.trim().split("\n");

  var css = "";
  for (var i = 0; i < colors.length; i++) {
    css += ".var" + i + "{color:" + colors[i] + ";} ";
  }
  add_style_sheet(css);
}

It starts on line 232 of my JSFiddle: https://jsfiddle.net/Fuzzoom/kk857hgc/

Would someone mind explaining how to fix it, so that my JS script displays with CSS styling (When you click on "See My AJAX"), instead of just white text?

0 Answers0