我想在JavaScript中使用XMLHttpRequest发送一些数据.
假设我在HTML中有以下表单:
<form name="inputform" action="somewhere" method="post">
<input type="hidden" value="person" name="user">
<input type="hidden" value="password" name="pwd">
<input type="hidden" value="place" name="organization">
<input type="hidden" value="key" name="requiredkey">
</form>
Run Code Online (Sandbox Code Playgroud)
如何在JavaScript中使用XMLHttpRequest编写等效代码?
有没有办法使用post方法发送数据而没有表单,没有刷新页面只使用纯Javascript(不是jQuery $.post()
)?也许是httprequest或其他东西,现在找不到它.