title: Detect when a web page is loaded without using sleep
body: <p>I am creating a VB script on windows which opens a site in IE. What I want: Detect when the web page is loaded and display a message. I achieved this by using sleep (<code>WScript.Sleep</code>) for approx. seconds when the site gets loaded. However, the site pops up user name, password in the midway. Only when the user enter credentials, it finishes loading the page. So I don't want to use "sleep" for approx seconds, instead an exact function or a way to detect that the page got loaded. I checked on line and tried using <code>Do While</code> loop, <code>onload</code>, <code>onclick</code> functions, but nothing works. To simplify, even if I write a script to open a site like yahoo and detect, display a message "Hi" when the page is loaded: It doesn't work without using sleep (<code>WScript.Sleep</code>).</p>