Streaming live at 10am (PST)

Getting CORS error on AJAX requests to Webflow API

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 '' + 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'

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

Can’t call API using JavaScript :frowning_face:

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

How would I load in items from the API then?

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

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

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