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 5 years have passed since last update.

js readyState確認用コード

Last updated at Posted at 2019-07-23

webページのローディング状況によってdocumentのreadyStateの値が変遷する

そこでreadystatechangeイベントを拾い、アラートで通知してみる

check-readyState.js
alert(document.readyState); // -> 初回 'loading'
document.addEventListener('readystatechange', function () {   
  alert(document.readyState); // -> 2回目 'interactive'、 3回目 'complate'
});

以上。

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?