今天测试代码,安卓的qq浏览器9.7版本和 安卓的360安全浏览器出现一个bug
a.html 页面加下边代码
——————————————————————————<a href='b.html' id='aaa'></a>
<script>
setTimeout(function(){document.getElementById("aaa").click();}, 1200);
</script>如果打开a.html 并且手指主动点击(按)一下 a.html网页的任意位置,然后代码跳转到 b.html,按返回的时候会返回到 a.html如果打开a.html 什么都不管,代码自动跳转到 b.html,按返回的时候会直接退出有没有什么代码,让代码主动模拟手指按屏幕的操作,从而实现代码能返回到 a.html
a.html 页面加下边代码
——————————————————————————<a href='b.html' id='aaa'></a>
<script>
setTimeout(function(){document.getElementById("aaa").click();}, 1200);
</script>如果打开a.html 并且手指主动点击(按)一下 a.html网页的任意位置,然后代码跳转到 b.html,按返回的时候会返回到 a.html如果打开a.html 什么都不管,代码自动跳转到 b.html,按返回的时候会直接退出有没有什么代码,让代码主动模拟手指按屏幕的操作,从而实现代码能返回到 a.html
var onlongtouch;
var timer;
var touchduration = 500; touchstart() {
timer = setTimeout(onlongtouch, touchduration);
}touchend() {
if (timer)
clearTimeout(timer);
}onlongtouch = function() { //do something };