When I using window.open('[url=http://rere.vn')]http://rere.vn')[/url], it call a stock browser of my android fone. It is not display the site embedded in app. Is it normal? How to open an url inside app. I don't want open an url in other browser.
When I using window.open('[url=http://rere.vn')]http://rere.vn')[/url], it call a stock browser of my android fone. It is not display the site embedded in app. Is it normal? How to open an url inside app. I don't want open an url in other browser.
To open a page within your app, use PhoneGap's child browser:
code
var childBrowser = ChildBrowser.install();
window.plugins.childBrowser.showWebPage('http://google.com');
/code
Hi Max.
I can't seem to get the JS you posted to work. If I include the var childBrowser line in an event on load of my screen, the app just hangs both in the web preview and ios preview.
Do it on button click.
This code does not work, it does nothing on button click
Hi,
ChildBrowser is a PhoneGap plug-in that works for installed ipa/apk only, but not on browser.
Create new JavaScript asset with the following code:
codefunction myNavigate(url) {
var cb;
if (window.plugins) {
cb = window.plugins.childBrowser;
}
if (cb != null) {
cb.showWebPage(url);
} else {
window.open(url);
};
}/code
On Click event instead of code:
codevar childBrowser = ChildBrowser.install();
window.plugins.childBrowser.showWebPage('http://...');/code
run:
codemyNavigate('http://...');/code