JavaScript post request like a form submit shows you how to submit a form that you create via POST in JavaScript.
(像表单提交一样的JavaScript发布请求会向您展示如何提交您在JavaScript中通过POST创建的表单。)
Below is my modified code.(以下是我修改过的代码。)
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();
What I would like to do is open the results in a new window.
(我想做的是在新窗口中打开结果。)
I am currently using something like this to open a page in a new window:(我目前正在使用类似的东西在新窗口中打开一个页面:)
onclick = window.open(test.html, '', 'scrollbars=no,menubar=no,height=600,width=800,resizable=yes,toolbar=no,status=no');
ask by translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…