This is because you do this.runtime.getProjectFileUrl(nameScript) in the global scope. This is supposed to be executed from inside of the plugin/behavior instance. When you do this in the global scope, your "this" is a window object that has no "runtime" property.
From the global scope try c3runtime.getProjectFileUrl
Ashley With C3 Runtime I have this error:
Error executing JavaScript: TypeError: Cannot read property 'getProjectFileUrl' of undefined
This is my code:
> var nameScript= 'mathjs.js';
var realUrl = this.runtime.getProjectFileUrl(nameScript);
var jsFile = document.createElement('script');
jsFile.src = realUrl;
document.head.appendChild(jsFile);