Skip to content

Instantly share code, notes, and snippets.

@Marak
Created March 2, 2010 23:35
Show Gist options
  • Save Marak/320107 to your computer and use it in GitHub Desktop.
Save Marak/320107 to your computer and use it in GitHub Desktop.
$.getJSON = function(url, options, callback) {
$.ajax({
url: url,
global: false,
data : options,
contentType : "application/json",
dataType: "jsonp",
success: callback
});
};
$.ajaxSetup({ 'beforeSend': function(xhr) {xhr.setRequestHeader("Accept", "application/json")} })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment