Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Quick remarks :

* I could test it myself, but I expected to have in the article detailed information on the different possible states the document can have when my callback is called. The questions I know the answer when waiting for the whole document to be loaded : Is it half loaded ? What is the DOM state ? Is completely loaded ? If not, have the document JavaScript code been entirely ran ? and so on. This kind of question left unanswered often lead to hard bites.

* why using "itself" ? I would have used a "sensible default" : when no context is given, use the waited DOM object instead of an arbitrary value (document), and use something else when it is explicitly given. The "itself" thing should be left as an internal flag IMHO.



1) The dom state is that everything inside the HTML element that you were waiting for already exists when the function is executed.

2) When i am writing javascript is very common for me to use the global object (window) as the context; so in my case is not a good idea to use the HTML element as context by default.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: