I have a function called f0 having some parameters. When i call it, it calls some other functions with some parameters(for example the same parameters). The problem is, can i add somehow these functions dynamically?
A simple solution would be something like this:
var callf1=true;
var callf2=true;
var callf3=true;
function f1(params){
//some code
}
function f2(params){
//some other code
}
function f3(params){
//some code
}
function f0(params){
if(callf1){
f1();
}
if(callf2){
f1();
}
if(callf3){
f1();
}
}
function mymain(){
f0(params);
}
setInterval("mymain()",5000);
This option is much time consuming because every time it has to check the variables. Could i use somehow the trigger option in JQuery using runtime and giving parameters?
I would be glad if you can recommend me an easier and simpler solution.