Skip to content

Instantly share code, notes, and snippets.

@Phocacius
Created January 24, 2015 19:44
Show Gist options
  • Save Phocacius/4b53bc8054f7cdd72e37 to your computer and use it in GitHub Desktop.
Save Phocacius/4b53bc8054f7cdd72e37 to your computer and use it in GitHub Desktop.
send http post via Javascript without Ajax
httpPost = function(url, params) {
var html = '<form action="' + url + '" method="post">';
for(key in params) {
html += '<input type="text" name="'+ key +'" value="'+ params[key] +'" />';
}
html += '</form>';
$(html).submit();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment