LoginSignup
0
0

More than 1 year has passed since last update.

.readyについて

Posted at

WEBページのドキュメントの処理が終わった後に
処理を行いたいときは以下のコードを使う

$("document").ready(function()){
//処理
}

↓省略形

$(function()){
//処理
};

ドキュメントのDOMの準備が整った後に処理を行う理由は
ドムの準備が整っていないときにドムの操作を行おうとすると、そのドムが存在しないので、
意図した動作を行えないから

逆に、WEBページがすべて読み込み終わった後に処理を行う方法として以下のコードもある

window.onload = function(){};
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