Wait for page to load in Jscript (not Java) - InfoPath Dev
in

InfoPath Dev

Wait for page to load in Jscript (not Java)

Last post 02-03-2009 10:46 AM by Hilary Stoupa. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 01-26-2009 09:31 AM

    Wait for page to load in Jscript (not Java)

     I'm new to Jscript. I am trying to open a page, and wait for the page to finish loading, then enter the Username and Password and hit enter.

     Steps are:

    1. Open webpage in IE7
    2. Wait for page to load
    3. Enter Username and Password, {enter}
    4. Wait for page to load
    5. Open second page on second tab in IE7

    I'm struggling with 'wait for page to open' and entering username and password in Jscript.

     I've tried the readystate != (4) in a while loop, but I keep getting an error.

     Any ideas? Code below:

    var navOpenInBackgroundTab = 0x1000;
    var oIE = new ActiveXObject("InternetExplorer.Application");


    oIE.Navigate2("https://mail.google.com/a/sabic-ip.com/");

    oIE.Visible = true;

    While (oIE.readyState != 4) //This does not work in Jscript.
    {
    WScript.Sleep (1000);
    }

    oIE.Navigate2("https://calendar.google.com/a/sabic-ip.com/", navOpenInBackgroundTab);

    WScript.Quit(1)
     

     

     

  • 02-03-2009 09:45 AM In reply to

    Re: Wait for page to load in Jscript (not Java)

     Bump

  • 02-03-2009 10:46 AM In reply to

    Re: Wait for page to load in Jscript (not Java)

    Hi:

    This forum is dedicated to InfoPath form development. You may have better response to your post at a forum for javascript development, like one of these:

    http://www.webdeveloper.com/forum/forumdisplay.php?forumid=3&s
    http://www.tek-tips.com/threadminder.cfm?pid=216

    Hilary Stoupa

Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.