Javascript 如何使用java脚本在android中打开外部页面?
我使用的是cordova 1.8,我想在我的应用程序中使用本机浏览器打开外部网页,我搜索了,但没有得到答案。然而,我写了一段代码片段。 有什么建议吗Javascript 如何使用java脚本在android中打开外部页面?,javascript,cordova,Javascript,Cordova,我使用的是cordova 1.8,我想在我的应用程序中使用本机浏览器打开外部网页,我搜索了,但没有得到答案。然而,我写了一段代码片段。 有什么建议吗 <!Doctype> <html> <head> <title>demo browser</title> <script type="text/javascript" charset="utf-8" src="cordova-1.8.0.js"></scr
<!Doctype>
<html>
<head>
<title>demo browser</title>
<script type="text/javascript" charset="utf-8" src="cordova-1.8.0.js"></script>
<script type="text/javascript" charset="utf-8" src="childbrowser.js"></script>
<script>
function onDeviceReady() {
window.plugins.childBrowser.showWebPage("http://www.google.com", { showLocationBar: true });
}
</script>
</head>
<body>
hello visitor<br><br>
<button onClick="onDeviceReady();">click to open</button></body>
</html>
演示浏览器
函数ondevicerady(){
window.plugins.childBrowser.showWebPage(“http://www.google.com“,{showLocationBar:true});
}
您好,访客
点击打开
只需调用intent即可查看url:
String uri_str;
Uri uri = Uri.parse(uri_str);
Intent i = new Intent(Intent.ACTION_VIEW, uri);
startActivity(i);
试试谷歌搜索“安卓网络视图”