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オブジェクトとは
スクリプト言語でサーバーとのHTTP通信を行うための組み込みオブジェクト。

<よく使うメソッド>
◎open
 (使える場面)
 ・新しく作成されたリクエストを初期化したいとき
 ・既存のリクエストを再初期化したいとき

 (例)

index.js
var ajax = new XMLHttpRequest();
ajax.open('GET', 'URL');

◎responseType
 列挙型の文字列地
 (使える場面)
 ・レスポンスに含まれているデータの型を示したいとき
 ・レスポンスの型を変更したいとき

 (例)

index.js
var ajax = new XMLHttpRequest();
ajax.responseType = 'json';

◎send
 (使える場面)
 ・リクエストをサーバーに送信したいとき

 (例)

index.js
var ajax = new XMLHttpRequest();
ajax.send(null);
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?