Skip to content

Instantly share code, notes, and snippets.

@DCarper
Created March 21, 2011 18:49
Show Gist options
  • Select an option

  • Save DCarper/879967 to your computer and use it in GitHub Desktop.

Select an option

Save DCarper/879967 to your computer and use it in GitHub Desktop.
$.ajax({ url: this.action+'.json',
dataType: 'json',
accepts: 'text/json',
data: $(this).serialize(),
type: 'post',
success: function(data, textStatus, XMLHttpRequest) { ... }})
// this works in all browsers except IE.. when sent from IE the server thinks it's asking for a mimetype of image/gif
// i have tried all combinations of including and excluding "accepts", "dataType", and adding ".json" onto the end of the form action.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment