如何在javascipt里面不通过ajax,发送http post请求 各位大人 如何在javascipt里面不通过ajax,发送http post的同步请求?谢谢 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 可以使用DWR,不过他也是AJAX原理 那你直接激活form的submit跳转吧。。 <html><script>function $(id){ if(document.getElementById){ return document.getElementById(id); }} window.onload = function(){ $('btnId').onclick = function(){ /* 可以通过修改form标签的属性,来达到你的目的。 */ if(confirm('确认要提交表单么?')){ var formObj = $('testFormId'); formObj.action = 'test.php?password=' + $('pwdId').value; formObj.method = 'POST'; formObj.submit(); } };} </script> <body> <form name="testForm" id="testFormId"> 用户名:<input type="text" id="userId"><br> 密码:<input type="password" id="pwdId"><br> <input type="button" id="btnId" value="提交"/> </form></body></html> 利用javascript直接发送请求function sendform(){ document.form1.submit();}sendform(); kissy JS 调用问题 JS操作数组 浏览器 框架的超越 问个js在IE和FF下不兼容的问题 请问如何取传过来值中的一部分值 JS修改input类型的问题,纠结的我。。。抓头 一个关于正则表达式匹配的简单问题!急……! jsp 代码部分怎么定义java script的变量? 是这样写的吗:out.println("var CourseID="""+strCourseID+""";\r\n"); java script函数怎样接受一个form的名字做参数.document.formname这样的参数 JS如何修改Heck的CSS样式 大家帮忙修改一个脚本!!
<html>
<script>
function $(id){
if(document.getElementById){
return document.getElementById(id);
}
}
window.onload = function(){
$('btnId').onclick = function(){
/*
可以通过修改form标签的属性,来达到你的目的。
*/
if(confirm('确认要提交表单么?')){
var formObj = $('testFormId');
formObj.action = 'test.php?password=' + $('pwdId').value;
formObj.method = 'POST';
formObj.submit();
}
};}
</script>
<body>
<form name="testForm" id="testFormId">
用户名:<input type="text" id="userId"><br>
密码:<input type="password" id="pwdId"><br>
<input type="button" id="btnId" value="提交"/>
</form>
</body>
</html>
document.form1.submit();
}sendform();