Chinaunix

标题: JavaScript怎么发出POST请求? [打印本页]

作者: flyfrogs    时间: 2008-12-21 21:07
标题: JavaScript怎么发出POST请求?
JavaScript代码。
在网页中一般用window.location.href=""来发出GET请求,
那怎么通过JavaScript语句发出POST请求?
作者: 书中蠹鱼    时间: 2008-12-22 10:24
好像ajax可以post
作者: flyfrogs    时间: 2008-12-26 20:57
难道就没有一般的语句?
作者: tomorrow819    时间: 2009-01-06 17:10
先在html里定义个form,然后提交这个form 。
document.getElementById('frm').action = "/text/1.html";
document.getElementById('frm').submit();




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2