Skip to content

Instantly share code, notes, and snippets.

Avatar

Željko Ziriković joshefin

View GitHub Profile
@joshefin
joshefin / gist:4506897
Created Jan 11, 2013
Multipart cross domain post request with ajax
View gist:4506897
var data = new FormData();
form.find("input, textarea").each(function() {
var input = $(this);
if (input.attr("type") == "file")
data.append(input.attr("name"), input[0].files[0]);
else
data.append(input.attr("name"), input.val());
});
$.ajax({