Try to use getJSON with function onClick but get eception TypeError

Eception TypeError: cannot read property ' $"undefined


Hi, I am using the getJSON function when a button is clicked. However, I get the above error. However if I use the code under compositionReady, everything works fine.


But I want my app to work so that, when I click the button, the function gets information about the json file and displays information dynamically. What is the right solution to implement this function. I think I can use this function inside the compositionReady function, just hide the information and display when the user clicks the button. But is there another way or approach I can take?


$.getJSON ("content. JSON")

(.the)

{function (Data)}

Console.log ("incoming data:", data);

$(données, fonction (index, item) {} .each)

var l = sym.createChildSymbol ('template', 'content');

l. $("item") (item.item) .html.

l. $("description") .html (item.description);

l.Play (index *-500);

});

});

Looking at your files.

If you replace this line: var s = sym.createChildSymbol ('template', 'content');

by this line: var s = sym.createChildSymbol ('template', sym.getParentSymbol (). $("content"));
Your JSON file is returned but...

Tags: Edge Animate

Similar Questions

Maybe you are looking for