フォーム送信のような JavaScript ポスト リクエストは、JavaScript で POST を介して作成したフォームを送信する方法を示しています。以下は私の変更されたコードです。
var form = document.createElement("form");
form.setAttribute("method", "post");
form.setAttribute("action", "test.jsp");
var hiddenField = document.createElement("input");
hiddenField.setAttribute("name", "id");
hiddenField.setAttribute("value", "bob");
form.appendChild(hiddenField);
document.body.appendChild(form); // Not entirely sure if this is necessary
form.submit();
私がやりたいことは、結果を新しいウィンドウで開くことです。現在、次のようなものを使用して、新しいウィンドウでページを開いています。
onclick = window.open(test.html, '', 'scrollbars=no,menubar=no,height=600,width=800,resizable=yes,toolbar=no,status=no');