LoginSignup
0
0

More than 3 years have passed since last update.

JavaScriptを用いて非同期通信実装②

Posted at

とうとうajaxを使うよ

根幹であるajaxを使います。
そもそもどんなタイプがあるのかみていきます。
type:HTTPの通信方法を書く。GETかPOSTの2種類しかありません。
url:リクエストを送信する先のURLを記述する。
data:サーバーに送信する値を記述する
dataType:データ送信される型を指定する

$.ajax({
      type: 'POST',
      url: '',
      data: ,
      dataType: 'json'
    })

データタイプは今回非同期通信なのでjsonを指定しています。
これが非同期通信で忘れてはならない手順です。
次はdoneとfailについて書きます。

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