$.ajax({
type: 'POST',
url: 'otherpage.php',
data: $('form').serialize(), //you may want to give id of the form which contains elements you want to POST
success: function(){
//code on success
},
dataType: 'html'
});
edit 1
incase you want to specify your own parameters to send then use:
$.ajax({
type: 'POST',
url: 'otherpage.php',
data: {
paramname1 : "put_param_value_here",
paramname2 : "put_param_value_here",
paramname3 : "put_param_value_here"
},
success: function(){
//code on success
},
dataType: 'html'
});
Edit 2: if you only want to post your own parameters to a page (no ajax. simple POST which will open the page then do the following)
function postToUrl(url, params, newWindow)
{
var form = $('<form>');
form.attr('action', url);
form.attr('method', 'POST');
if(newWindow){ form.attr('target', '_blank'); }
var addParam = function(paramName, paramValue){
var input = $('<input type="hidden">');
input.attr({ 'id': paramName,
'name': paramName,
'value': paramValue });
form.append(input);
};
// Params is an Array.
if(params instanceof Array){
for(var i=0; i<params.length; i++){
addParam(i, params[i]);
}
}
// Params is an Associative array or Object.
if(params instanceof Object){
for(var key in params){
addParam(key, params[key]);
}
}
// Submit the form, then remove it from the page
form.appendTo(document.body);
form.submit();
}
call like this:-
postToUrl('otherpage.php', {paramname1: "value_here", paramname2: "value_here"});
code taken from answer on JavaScript post request like a form submit