core.js
// load experiment module js file. All experiments are written in js, no separate html file
load experiment module js file. All experiments are written in js, no separate html file
load experiment module js file . All experiments are written in js no separate html file
function loadJS (ID) {
  if (!document.getElementById(ID +'JS')) {
    expDir = path.join(__dirname, '/experiments/', ID, path.sep)
    scrElement = document.createElement("script")
    scrElement.type = "application/javascript"
    scrElement.src = expDir + ID + '.js'
    scrElement.id = ID + 'JS'
    document.body.appendChild(scrElement)
    console.log('loaded: ', scrElement.src)
  }
}
function loadJS ( ID ) { if ( ! document . getElementById ( ID + 'JS' ) ) { expDir = path . join ( __dirname , '/experiments/' , ID , path . sep ) scrElement = document . createElement ( "script" ) scrElement . type = "application/javascript" scrElement . src = expDir + ID + '.js' scrElement . id = ID + 'JS' document . body . appendChild ( scrElement ) console . log ( 'loaded: ' , scrElement . src ) } }
load experiment module js file.
load experiment module js file .
//might need to wait for scrElement.onload event -- test this //http://stackoverflow.com/a/38834971/3280952