當前位置:編程學習大全網 - 網站源碼 - h5 頁面window.location.href android 不跳轉怎麽辦

h5 頁面window.location.href android 不跳轉怎麽辦

原因可能是因為在href中的javascript:void(0)阻止的事件行為,解決方法如下:

1.在onclick事件中加return false來阻止冒泡:

代碼如下:

$("a").click(function(){

window.location.href = "xxx.html";

reutrn false;

})

2.延遲100毫秒

代碼如下:

$("a").click(function(){

setTimeout(function(){

window.location.href = "xxx.html";

},100);

})

  • 上一篇:明日科技:VC++的書實在太爛了,大家推薦下好的VC++書來看看
  • 下一篇:享庫生活又是什麽騙局
  • copyright 2024編程學習大全網