I have defined a global variable ff and then call f1 to assign function f3 to it. When I call f2, f3 will running.
var ff;
function f1() { ff=f3; }
function f2() { ff(); }
function f3() { alert("hello"); }
but if f3 take a parameter as following
function f3(txt) { alert(txt); }
and I call f1 to assign ff as following
function f1() { ff=f3("hello"); }
f3 will run at the same time.
I don't want f3 running when I assign it to ff and I need pass a argument. How can I achieve this? A variable with () after it as if will make it a function and make it run.