i have a very little problem but don't know how to solve it. I need to send a 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, need to pass the func function as parameter with parameters.
Example:
var jsonVariable = { var1 : 'value1', var2 : 'value2', func: funcParam(param1,param2) };
function(parameter1, parameter2){
alert(parameter1 + parameter2);
}
But this don't work :(
Any help with this will be really appreaciated
In addition, JSON can not contain functions. Any JSON text must contain valid JavaScript expressions. In some browser engines, the U+2028 line separator and U+2029 paragraph separator are allowed in string literals and property keys in JSON, but when using them in JavaScript code will result in SyntaxError.
The JSON parameters file provides parameters that you can change to modify the functionality of Log Analysis Tool. Using this file provides you full control over the job without JCL re-generation and ISPF interaction. This section provides more detailed information on the JSON parameter file.
It's a bit unclear what you want, but if you want to define a function which accepts parameters, you'll want something like this;
var jsonVariable = { var1 : 'value1', var2 : 'value2', func: function(param1, param2){ alert(param1 + param2); } };
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With