无法使用应用程序浏览器打开 url
Cannot open url with inAppBrowser
我已经在xcode中破解这个应用程序一段时间了。 我已经构建了几个 html 页面并集成了 inAppBrowser,因此 url 在设备默认浏览器中打开。 这在我的所有其他页面上都非常有效,但是当我尝试对这个特定页面做同样的事情时,网址永远不会打开? 我觉得这是一个javascript错误,但我的JS知识充其量是最低限度的。
如何让网址像在其他页面上一样使用 inAppBrowser 在此特定页面上打开? 除了这个页面有自己的用于播放媒体的JS之外,没有什么不同。
任何帮助将不胜感激。 感谢
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
<meta name="viewport" content="width=device-width, user-scalable=no" />
<!-- <link rel="stylesheet" href="css/index.css"> -->
<title>My App</title>
<style>
* {
-webkit-touch-callout: none;
-webkit-user-select: none;
}
</style>
</head>
<body>
<script type="text/javascript" src="cordova.ios.js"></script>
<script type="text/javascript" charset="utf-8" src="video.js"></script>
<script type="text/javascript">
function playbeachcam(){
document.getElementById('bankschanneldiv').style.display= "none";
document.getElementById('beachcamdiv').style.display= "block";
document.getElementById('looperscamdiv').style.display= "none";
// window.plugins.videoPlayer.play("http://.../playlist.m3u8");
}
function playloopercam(){
document.getElementById('bankschanneldiv').style.display= "none";
document.getElementById('beachcamdiv').style.display= "none";
document.getElementById('looperscamdiv').style.display= "block";
// window.plugins.videoPlayer.play("http://.../playlist.m3u8");
}
function playbankcam(){
document.getElementById('bankschanneldiv').style.display= "block";
document.getElementById('beachcamdiv').style.display= "none";
document.getElementById('looperscamdiv').style.display= "none";
//window.plugins.videoPlayer.play("http://.../playlist.m3u8");
}
function openHome() {
var ref = window.open('http://www.google.com/', '_blank', 'location=yes');
ref.addEventListener('loadstart', function() { alert('start: ' + event.url); });
ref.addEventListener('loadstop', function() { alert('stop: ' + event.url); });
ref.addEventListener('exit', function() { alert(event.type); });
}
</script>
<div class="header-container" data-role="header">
<div style=" text-align:left;margin-left:15px;">
<a href="index.html" style="text-decoration:none;"><img style="width: 59px; height: 50px" src="img/wbl-logo.png" />
<span style="width:auto;position:absolute;bottom:25%;margin-left:10px;font-size:22px;color:#07a54a;">My App</span></a>
</div> <!-- end logo -->
<div style="text-align:right;width:auto;position:absolute;right:5%;top:30%;">
<a class="ui-btn ui-shadow ui-btn-corner-all ui-btn-inline ui-btn-up-c" data-inline="true" data-transition="slide" data-role="button" href="#menu" data-corners="true" data-shadow="true" data-iconshadow="true" data-wrapperels="span" data-theme="c">
<span class="ui-btn-inner ui-btn-corner-all">
<span class="ui-btn-text" style="color:#0267a6;">MENU</span>
</span>
</a>
</div><!-- end menu -->
</div><!-- end header -->
<div class="content-container" data-role="content">
<div id="wrapper" style="bottom:5px;">
<div id="main-content">
<button id="BeachCam" onClick="playbeachcam();" >
Play Beach Cam
</button>
<br/>
<button id="LooperStar" onClick="playloopercam();">
Play Looper Cam
</button>
<br/>
<button id="BanksChannel" onClick="playbankcam();">
Play Banks Cam
</button>
<div id = "bankschanneldiv" style="display:none;">
<video
id="mediaplayer1"
controls="1"
autoplay="1"
height="218"
preload="none"
src="http://.../playlist.m3u8"
width="100%">
</video>
</div>
<div id = "beachcamdiv" style="display:none;">
<video
id="mediaplayer2"
controls="1"
autoplay="1"
height="218"
preload="none"
src="http://.../playlist.m3u8"
width="100%">
</video>
</div>
<div id = "looperscamdiv" style="display:none;">
<video
id="mediaplayer3"
controls="1"
autoplay="1"
height="218"
preload="none"
src="http://.../playlist.m3u8"
width="100%">
</video>
</div>
<p style="color:#f4f4f4;">Having Trouble?</p>
<p><a style="color:#07a54a;text-shadow:1px 1px 1px #333;" href="#" onclick='openHome()' target="_blank" >View the cams on our website</a></p>
</div>
</div>
</div>
<div class="footer ui-bar-a" data-role="footer" role="contentinfo">
<div style="text-align:center;width:auto;margin:10px 0;">
<a href="#" onclick='openHome()' target="_blank" style="text-decoration:none;color:#291e0f;">My Footer </a>
</div> <!-- end footer content -->
</div><!-- end footer -->
</body>
</html>
经过进一步的故障排除,我发现这就是问题所在:
<script type="text/javascript" src="cordova.ios.js"></script>
所以现在我找到了解决方法,一切都解决了。
相关文章:
- 如何在现有的浏览器选项卡中打开url
- 如何使用javascript从同一浏览器下的其他页面获取URL?有可能吗
- 当URL以m.(网站).com开头时,浏览器需要自行调整大小
- 使用现有代码更改基于浏览器宽度的图像url
- /如何使用java脚本在safari浏览器中获取活动的Tab url
- 在浏览器中更改页面的URL,无需刷新和HTML5模式
- 浏览器's将AngularJS变量加载为URL
- GWT:在浏览器中保存URL'的书签部分
- iframe url在浏览器上打开
- 是否可以使用javascript从浏览器获取访问的上一页的URL
- 是否可以更改更改特定事件在地址栏或浏览器中的URL
- 浏览器将超链接指定的href解释为完全不同的url
- 浏览器向url添加一些数字
- 在浏览器操作中修改当前选项卡的URL的TLD
- 在浏览器上不打开url的情况下自动请求
- 通过javascript从浏览器历史记录中删除URL
- 使用javascript在chrome浏览器的新选项卡中以程序方式打开URL
- 用于浏览器检测和url链接的脚本
- 角度路由;在浏览器中直接访问URL时不起作用,但在单击时起作用
- window.open()打开错误的URL.浏览器会记住它直到注销