-1

I want to retrive a detail of a video throught the redtube API. if i copy and paste the link in the browser all works fine http://api.redtube.com/?data=redtube.Videos.getVideoById&video_id=15485&output=json&thumbsize=all

Note: May be offensive to some users, it's a porn API.

But when i attempt to receive the json object throught an ajax call, no result is given and the call goes in error

$.ajax({
      url : 'http://api.redtube.com/?data=redtube.Videos.getVideoById&video_id=15485&output=json&thumbsize=all',
      dataType : 'json',
      success: function (res) 
                {
                 alert (res)

                },
     error : function (res) {alert(res.code);}      
})

Why?

Dave Newton
  • 158,873
  • 26
  • 254
  • 302

1 Answers1

1

You can't make AJAX call to the API due to same-origin policy. Learn more about it here

Stanley
  • 5,057
  • 4
  • 34
  • 44