Passing information from jsx to js.
Hello Community,
I have a problem with passing information from jsx to js file.
my jsx file:
$.extendScript = {
test : function() {
return "string";
},
}
my js file.
(function () {
var cs = new CSInterface();
var variable = "";
cs.evalScript('$.extendScript.test()', function(result) {
variable = result;
alert("variable in evalScript =" + variable);
});
alert("variable in outside = " + variable);
}());
In evalScript function the variable get's the string from jsx function but when I want to use it outside I get empty string again.
Also I get the alert outside evalScript first in order. Why this happens?
Does anyone know why this happens and how to fix this?
Best Regards
