【发布时间】:2017-10-28 03:06:04
【问题描述】:
我下面的两个代码运行良好。第一个代码在电脑上运行良好,第二个代码在手机上运行。但我想在移动设备上使用第一个代码和第二个代码代理在 30 秒后自动重新加载。
如何在第一个代码上添加第二个移动代理代码?
第一个代码:
<script>
window.setInterval("reloadIFrame();", 30000);
function reloadIFrame() {
document.getElementById("test").src="http://example.com";
}
</script>
第二个代码:
<script>
var isMobile = function() {
return /(iphone|ipod|ipad|android|blackberry|windows
ce|palm|symbian)/i.test(navigator.userAgent);
};
if(isMobile()) {
window.location.href = "https://example.com";
}
</script>
对不起,英语不好。
请帮我解决它。谢谢
【问题讨论】:
标签: javascript jquery iframe jquery-mobile mobile