Quantcast
Channel: How to fix XMLHttpRequest error while loading XML feed form a different domain using jQuery? - Stack Overflow
Viewing all articles
Browse latest Browse all 2

Answer by Naveen J for How to fix XMLHttpRequest error while loading XML feed form a different domain using jQuery?

$
0
0

Please read the vimeo API - User

Making the URL

http://vimeo.com/api/v2/username/request.output
username Either the shortcut URL or ID of the user, an email address will NOT work.
request The data you want. The different request types are listed below.
output Specify the output type. We currently offer JSON, PHP and XML formats.

So instead of making a request like http://vimeo.com/api/v2//videos.xml make a request like http://vimeo.com/api/v2//videos.json

Now you can use $.getJSON to get the results like this.

$(document).ready(function() {    var url = "http://vimeo.com/api/v2/{username}/videos.json?callback=?";    $.getJSON(url, function(data) {        var items = [];        $.each(data, function(key, datum) {            items.push("<ul>");            items.push("<li>Title: "+ datum.title +"</li>");            items.push("<li>Tags: "+ datum.tags +"</li>");            items.push("</ul>");        });        $("#result").html(items.join(""));    });});

View Demo: http://jsfiddle.net/naveen/Ssdjp/1/


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>