Page 1 of 1

Opening Webpage within App

Posted: Tue Jul 23, 2013 7:24 am
by Administration department

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


Opening Webpage within App

Posted: Tue Jul 23, 2013 8:13 am
by David6064062

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


Opening Webpage within App

Posted: Tue Jul 23, 2013 9:14 am
by Administration department

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


Opening Webpage within App

Posted: Tue Jul 23, 2013 9:35 am
by Kateryna Grynko

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


Opening Webpage within App

Posted: Tue Jul 23, 2013 10:03 am
by Administration department

Hi

Thankyou for your help with this.

Best regards


Opening Webpage within App

Posted: Tue Jul 23, 2013 12:01 pm
by David6064062

No on device only