title: Close Childbrowser forward to html
body: <p>Using Childbrowser. My case:</p>
  
  <ul>
  <li>haveing an index.html file and test.html.</li>
  <li>going to test.html</li>
  <li>start Childbrowser from test.html  </li>
  <li>I press the "Done"-button on the top left corner</li>
  <li>Childbrowser is closing and returns to the last open page from my app, in this case www/test.hml</li>
  </ul>
  
  <p>I want to redirect/forward Childbrowser to my index.html of phone gap? How can I do it?</p>
  
  <p>js-file:</p>
  
  <p>// Callback when the user chooses the 'Done' button
  // called from native</p>
  
  <pre><code>ChildBrowser._onClose = function()
  {
      window.plugins.childBrowser.onClose();
  };
  </code></pre>
  
  <p>Code Snippet from .m file:</p>
  
  <pre><code>- (void)closeBrowser
  {
  
      if (self.delegate != nil) {
          [self.delegate onClose];
      }
      if ([self respondsToSelector:@selector(presentingViewController)]) {
          // Reference UIViewController.h Line:179 for update to iOS 5 difference - @RandyMcMillan
          [[self presentingViewController] dismissViewControllerAnimated:YES completion:nil];
      } else {
          [[self parentViewController] dismissModalViewControllerAnimated:YES];
      }
  }
  
  - (IBAction)onDoneButtonPress:(id)sender
  { 
      [self closeBrowser];
      NSURLRequest* request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"about:blank"]];
      [self.webView loadRequest:request];
  }
  </code></pre>
  
  <p>And the other .m file: </p>
  
  <pre><code>- (void)close:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options // args: url
  {
      [self.childBrowser closeBrowser];
  }
  
  - (void)onClose
  {
      [self.webView stringByEvaluatingJavaScriptFromString:@"window.plugins.childBrowser.onClose();"];
  }
  </code></pre>