5
提交POST表单后,打开一个显示结果的新窗口
JavaScript提交请求(例如表单提交)向您展示了如何提交通过POST在JavaScript中创建的表单。下面是我修改的代码。 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');
149
javascript
html
post