Streaming live at 10am (PST)

Getting CORS error on AJAX requests to Webflow API


#1

I’m trying to fetch from the API and getting a CORs error with the Infinitescroll plugin.

var collection_id = '595569be2559b63b8367850a';
var page = 1;
var limit = 2;

var $container = $( '.m-career-list').infiniteScroll({
  path: function () {
    return 'https://api.webflow.com/collections/' + collection_id + '/items?limit=' + limit + '&offset=' + (limit * page++) + '&access_token=' + webflow_token + '&api_version=1.0.0';  
  },
  // load response as flat text
  responseType: 'text',
  history: false,
  dataType: 'json'
});

#2

@PixelGeek Any ideas on this? It’s currently blocking a big feature for a site I’m working on.


#3

Can’t call API using JavaScript :frowning_face:

Otherwise I would have many cool demos up and running already.


#4

How would I load in items from the API then?


#5

Need to create a server side app/proxy that does that, and hosted elsewhere.


#6

You’re kidding. I’m on a paid plan…? You’re saying there’s no way around this, not even with jsonp or some other method of fetching public data? AND, I have to go build my own server! haha that’s crazy


#7

This topic was automatically closed after 60 days. New replies are no longer allowed.