Is it possible to send post-variables with javascript?
I want id
to be sent with post, not get.
window.location.href=\"hanteraTaBortAnvandare.ph
You can use a form and then document.getElementById('id_of_the_form').submit();
The form doesn't need to be wrote as plain HTML: you can create it dinamically:
function postIt() {
form = document.createElement('form');
form.setAttribute('method', 'POST');
form.setAttribute('action', 'someURL');
myvar = document.createElement('input');
myvar.setAttribute('name', 'somename');
myvar.setAttribute('type', 'hidden');
myvar.setAttribute('value', 'somevalue');
form.appendChild(myvar);
document.body.appendChild(form);
form.submit();
}