Close ChildBrowser When Done With It?

2 posts, 0 answers
  1. Brad
    Brad avatar
    30 posts
    Member since:
    Sep 2010

    Posted 24 Dec 2012 Link to this post

    I show the childBrowser using this code:
         window.plugins.childBrowser.showWebPage('http://mywebaddress/myPage.html', { showLocationBar: false });

    Is there anything I can put on the page inside that childBrowser control to allow it to close itself and return to the starting page?

    Thanks
  2. Brad
    Brad avatar
    30 posts
    Member since:
    Sep 2010

    Posted 24 Dec 2012 Link to this post

    I figured this out, but thought the solution could help others.  Poll the childBrowser for my exit url.  If found, close the window.  Works great!

    window.plugins.childBrowser.onLocationChange = function(loc){ if (loc.indexOf("exit.htm") >= 0) { window.plugins.childBrowser.close(); }}   

    window.plugins.childBrowser.showWebPage('http://' + server, { showLocationBar: false });
Back to Top