- var myObject;
- $.getJSON("https://gdata.youtube.com/feeds/api/videos/SPtEUAFm6Yk?v=2&alt=json", function( data ) {
- myObject=data;
- console.log(myObject.entry.content.src);
- });
- console.log(myObject.entry.content.src);
inside the callback function I can iterate the myObject and get all the properties but outside the function it sayas undefined. Please advice once we get json data back , can I save it in some other object for use later?