我想達到相同...非棄用等效
window.open('lalala.php', 'lalala', '...');
但我想發送HTTP POST請求而不是HTTP GET請求。因此,我使用了以下內容:
$('<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
然而,target
屬性已被棄用。有沒有辦法通過非棄用的方式來實現我想要做的事情?
不要總是相信W3Schools的 – 2011-01-28 13:39:36
*不要*相信W3Schools的,直到你已經看到,實際上是值得信賴的來源證據支持。 – Quentin 2011-01-28 13:51:29
那麼,這是一個可靠的來源? (並且,順便說一下,W3C是否可以起訴這些w3schools球員?) – pyon 2011-01-28 13:54:54