I have code like this
var e = new window[className](...);
where
className
is a name of some "class" I've created and is specified in an attribute in my html. All I had to do was make sure I had loaded a constructor/function of the name in className and it worked.
I've started getting all my stuff into require and this has unsurprisingly stopped working. I have a file Eric.js which I have required, and contains
define('Eric',function(){
var Eric = function (ED) {
...
};
// etc
return Eric;
});
but
require(['wtt/Eric']);
className='Eric';
var e = new window[className](...);
produces
TypeError: window[className] is not a constructor