0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

非同期通信 XMLHttpRequest

Posted at

このようにXMLHttpRequestの基本的な使い方は,次の4ステップからなります。

new XMLHttpRequestでオブジェクトを作る
openメソッドで送信時のメソッド,送信先URL,非同期通信か同期通信か真偽値で設定
onreadystatechangeで読み込み時の動作を指定
sendメソッドでリクエストを送信,引数はGETの場合nullを,POSTの場合はデータを&で繋げた文字列にして渡す。
openメソッドの第3引数で同期通信にすることも可能ですが,同期通信はsendしてからサーバーのレスポンスがあるまでJavaScriptの処理をすべて止めてしまうため,ユーザーを待たせてしまいます。省略時は非同期通信になるので,省略してもかまいません。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?