I have very few problems, but I donβt know how to solve it. I need to send JSON with a function, but with parameters, and this is my problem.
Sending a function in JSON is simple:
var jsonVariable = { var1 : 'value1', var2 : 'value2', func: function(){ alert('something'); } };
I need something else, I need to pass the func function as a parameter with parameters.
Example:
var jsonVariable = { var1 : 'value1', var2 : 'value2', func: funcParam(param1,param2) };
function(parameter1, parameter2){
alert(parameter1 + parameter2);
}
But this does not work :(
Any help with this will be truly appreciated.
source
share