Cross Domain error - i thought i'm using jsonp (?) so what's wrong

I just wanted to let you know that i found the solution with the help of other Campers :slight_smile:

What surprised me, was that i didn’t need to add a prefix “https://crossorigin.me/”, to the link. I’ve seen some posts that this is the only way to get around cross origin issues on codepen, but it works without it.

The only thing that worries me, is that i wasn’t able to make it work with $.getJSON. I still don’t know why.

This is the code that worked:

   $.ajax({
          url: mainLink,
          type: "GET",
          dataType: "jsonp",
          success: function (data) {
      console.log(data); 
// and other stuff i do with the data i get 
  }, 
          xhrFields: {
        withCredentials: false
      } 
        }) // end ajax
1 Like