Hi ,
I want to get the json data from the youtube api (http://
code.google.com/apis/youtube/developers_guide_protocol.html).

My code is like :
 url="http://gdata.youtube.com/feeds/api/videos?format=1&vq=cat&start-
index=10&max-results=20&orderby=viewCount&alt=json";

$.getJSON(url,callBackFucntion);

function callBackFucntion ()
{
  // here parse the json data
}

But i got an error when i run this code.
[Exception... "'Permission denied to call method XMLHttpRequest.open'
when calling method: [nsIDOMEventListener::handleEvent]" nsresult:
"0x8057001e (NS_ERROR_XPC_JS_THREW_STRING)" location: "<unknown>"
data: no]

so agian i change the url and add the callback parameter with ?  :
  url="http://gdata.youtube.com/feeds/api/videos?format=1&vq=cat&start-
index=10&max-results=20&orderby=viewCount&alt=json&callback=?";
     $.getJSON(url,fucntion (data){ // parse json data
               alert ('json data get');

});

This time i do not get error . But i do not get the call back

So how can i get the json data problem

Thanks
Saidur Rahman

Reply via email to