Created
May 28, 2018 11:13
-
-
Save twesolowski/97bfae4364784653963e5ae4ad2c2eac to your computer and use it in GitHub Desktop.
util
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var util = {}; | |
util.post = function(url, target, fields) { | |
var $form = $('<form>', { | |
action: url, | |
target : target, | |
method: 'post' | |
}); | |
$.each(fields, function(key, val) { | |
$('<input>').attr({ | |
type: "hidden", | |
name: key, | |
value: val | |
}).appendTo($form); | |
}); | |
$form.appendTo('body').submit(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment