Administration department
Posts: 0
Joined: Mon Jul 22, 2013 11:27 pm

Opening Webpage within App

Hello, I'm trying to load a webpage within the app.

I was told to use the following code:
window.plugins.childBrowser.showWebPage('http://www.google.com', { showLocationBar: true });

But I have no idea, where I paste this code.

Basically I just want startpage, to load a webpage

Thankyou

David6064062
Posts: 0
Joined: Sat Jul 20, 2013 1:34 pm

Opening Webpage within App

Hi

From your startScreen
Select Events
startScreen Device Ready Run Java Script
Function
window.plugins.childBrowser.showWebPage('http://www.google.com', { showLocationBar: true });

Best Regards

David

Administration department
Posts: 0
Joined: Mon Jul 22, 2013 11:27 pm

Opening Webpage within App

Hi

Will this work inside the test in browser preview ?

I ask because I followed the above steps, and the webpage did not open, was there another step I was meant to do, besides adding the event ?

Thankyou again

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Opening Webpage within App

Hi,

ChildBrowser is a PhoneGap plugin. It works on IPA/APK only, not on browser.
Create new JavaScript asset with the following code:
precodefunction myNavigate(url) {
var cb;
if (window.plugins) {
cb = window.plugins.childBrowser;
}
if (cb != null) {
cb.showWebPage(url);
} else {
window.open(url);
};
}/code/pre
When needed run JavaScript:codemyNavigate( URL );/code

Administration department
Posts: 0
Joined: Mon Jul 22, 2013 11:27 pm

Opening Webpage within App

Hi

Thankyou for your help with this.

Best regards

David6064062
Posts: 0
Joined: Sat Jul 20, 2013 1:34 pm

Opening Webpage within App

No on device only

Return to “Issues”