Matrix Version: 5.3.4.1
Hi, I’m wondering if there’s a way to make the output of a REST Resource Javascript Asset available in the Matrix context. I explain better:
Using REST Resource Javascript I’m loading a script file which create a javascript object with some properties. I’d like to have some of these properties available in other assets. I was thinking something like create a matrix global or session variable but I’m not sure it can be done from the javascript context.
Some code:
var response = _REST.responses[0].body;
eval(response); // this creates a “user” js object with name and surname properties
print(user.name); // this prints “Joe”
I’d like to make “Joe” available as a global variable so that I can use it anywhere in the site.
Is that possible?