Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Non-AJAX (HTTP) submit using JavaScript
function submit(action, method, values) {
var form = $('<form/>', {
action: action,
method: method
$.each(values, function() {
form.append($('<input/>', {
type: 'hidden',
value: this.value
submit('', 'POST', [
{ name: 'key1', value: 'value1' },
{ name: 'key2', value: 'value2' },
{ name: 'key3', value: 'value3' },
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.