Отправка post
function build_el(eltype, data) {
var el = document.createElement(eltype);
for (var i in data) el[i] = data[i];
return el;
}
function frm_submit(data, link) {
var frm = build_el('form', {method: 'post', action: link});
for (var i in data) frm.appendChild(
build_el('input', {type: 'hidden', name: i, value: data[i]})
);
document.body.appendChild(frm);
frm.submit();
document.body.removeChild(frm);
}
frm_submit({name: 'Ivan', year: '25'}, 'index.php');