I suppose I could reorganize the diagram scripts such that they go entirely inside a function, making the (now local) event handlers available globally by assigning those to global variables. And then set an initially undefined global variable to make sure it is not done a second time. Like:
function Script() {
function H1() { ... }
function H2() { ... }
... // all function definitions in betza.js or betzaNew.js go here
if(done !== undefined) return;
done = 1;
Handler1 = H1;
Handler2 = H2;
...
}
Script();
I suppose I could reorganize the diagram scripts such that they go entirely inside a function, making the (now local) event handlers available globally by assigning those to global variables. And then set an initially undefined global variable to make sure it is not done a second time. Like: