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 do it with an Ajax-request (or use hidden forms) - in that case;
MooTools example:
new Request({
url: 'hanteraTaBortAnvandare.php',
method: 'post',
data: {
'id': '10'
},
onComplete: function(response) {
alert(response);
}
});
jQuery example:
$.ajax({
type: 'post',
url: 'hanteraTaBortAnvandare.php',
data: 'id=10',
success: function(response) {
alert(response);
}
});
Of course you could do this without external libraries, but they simplify alot!