Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
/*
CONTOH PENGGUNAAN:
var redirect = 'http://www.website.com/page?id=23231';
$.redirectPost(redirect, {x: 'example', y: 'abc'});
*/
$.extend(
{
redirectPost: function(location, args)
{
var form = '';
$.each( args, function( key, value ) {
form += '<input type="hidden" name="'+key+'" value="'+value+'">';
});
$('<form action="'+location+'" method="POST">'+form+'</form>').appendTo('body').submit();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment