Skip to content

Instantly share code, notes, and snippets.

@benkant
Created November 16, 2014 00:45
Show Gist options
  • Save benkant/818592db681a8e741f55 to your computer and use it in GitHub Desktop.
Save benkant/818592db681a8e741f55 to your computer and use it in GitHub Desktop.
$.ajaxPrefilter( function( options ) {
if ( options.crossDomain ) {
var newData = {};
newData.data = $.extend({}, options.data);
newData.url = options.url;
options = {};
options.url = "http://www.baskettrack.co/proxy.php";
options.data = $.param(newData);
options.crossDomain = false;
}
});
$.ajax({
url: 'http://54.66.223.236/points/3',
data: { },
crossDomain: true,
processData: false
}).success(function(data) {
var jsonData = JSON.parse(data);
console.log(jsonData);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment