Everything works fine when I wrote the js logic in a closure as a single js file, as:
(function(win){
//main logic here
win.expose1 = ....
win.expose2 = ....
})(window)
but when I try to insert a logging alternative function before that closure in the same js file,
window.Glog = function(msg){
console.log(msg)
}
// this was added before the main closure.
(function(win){
//the former closure that contains the main javascript logic;
})(window)
it complains that there is a TypeError:
Uncaught TypeError: (intermediate value)(...) is not a function
What did I do wrong?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…