I want to achieve the same ...
window.open('lalala.php', 'lalala', '...');
But I want to send an HTTP POST request instead of an HTTP GET request. So I use the following:
$('<form/>').attr('action', 'lalala.php') .attr('target', 'lalala') // w3schools.org says this is deprecated .attr('method', 'post') .append(hiddenParam('param1', param1)) .append(hiddenParam('param2', param2)) .submit().remove(); // hiddenParam is a function I created that returns an input tag // the type attribute set to hidden, // the id attribute set to the first parameter, // and the value attribute set to the second parameter
However, the target attribute is deprecated. Is there a way to achieve what I'm trying to do with non-obsolete means?
dom html xhtml html-form forms
pyon
source share