I would like to parse a varialbe name into a JSON string:
JSON:
{
"items": [
{
"id": "2000",
"buttons": [{
"text": systemvar.continue,
}]
}
}
systemvar.continue is defined in Javascript.
How do I write the JSON code to use the Javascript variable?
Any ideas?
Best Kurt
JSON is a safe, restricted subset of JavaScript’s syntax. If you want to allow any JavaScript syntax, including that which is potentially unsafe, use
eval()instead ofJSON.parse().