Skip to content

Instantly share code, notes, and snippets.

@linusthe3rd
Created November 12, 2010 21:48
Show Gist options
  • Save linusthe3rd/674746 to your computer and use it in GitHub Desktop.
Save linusthe3rd/674746 to your computer and use it in GitHub Desktop.
var query_string = '';
$("someElement").each( function() {
if (this.checked) {
query_string += "&test[]=" + this.value;
}
});
$.ajax({
type: 'POST',
url: 'test.php',
data: 'id=1' + query_string,
success: function(t) {
$('div#content').empty().append(t);
},
error: function() {
$('div#content').append('An error occured during processing');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment