Skip to content

Instantly share code, notes, and snippets.

@yogasukma
Created November 8, 2016 08:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yogasukma/5951f05f5495c494cfbbe97a8ada380b to your computer and use it in GitHub Desktop.
Save yogasukma/5951f05f5495c494cfbbe97a8ada380b to your computer and use it in GitHub Desktop.
$.ajaxPrefilter( function (options) {
if (options.crossDomain && jQuery.support.cors) {
var http = (window.location.protocol === 'http:' ? 'http:' : 'https:');
options.url = http + '//cors-anywhere.herokuapp.com/' + options.url;
//options.url = "http://cors.corsproxy.io/url=" + options.url;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment