Ipad-window.confirm功能在popstate中不工作
我有这个示例代码,用于在按下浏览器的“后退”按钮时进行跟踪。该代码在计算机上与IE、Firefox和Safari协同工作。当我在Ipad上用Safari检查代码时,按下后退按钮时,.confirm对话框不显示。我已经在iOS 9.3上使用Safari 9进行了测试。Safari的设置允许弹出窗口 我不知道如何让代码在Ipad Safari上运行。有人有同样的问题吗Ipad-window.confirm功能在popstate中不工作,ipad,safari,confirm,popstate,Ipad,Safari,Confirm,Popstate,我有这个示例代码,用于在按下浏览器的“后退”按钮时进行跟踪。该代码在计算机上与IE、Firefox和Safari协同工作。当我在Ipad上用Safari检查代码时,按下后退按钮时,.confirm对话框不显示。我已经在iOS 9.3上使用Safari 9进行了测试。Safari的设置允许弹出窗口 我不知道如何让代码在Ipad Safari上运行。有人有同样的问题吗 <html> <head> </head> <body> <scrip
<html>
<head>
</head>
<body>
<script src="jquery-3.1.0.js"></script>
<script>
jQuery(document).ready(function ($) {
if (window.history && window.history.pushState) {
window.history.pushState(null, null, $(location).attr('href'));
$(window).on('popstate', function () {
$("#lblMessage").html("Onpopstate");
if (!confirm('Browse back?'))
window.history.pushState(null, null, $(location).attr('href'));
else
window.history.back();
});
}
});
</script>
<div id="lblMessage">Status
</div>
</body>
jQuery(文档).ready(函数($){
if(window.history&&window.history.pushState){
window.history.pushState(null,null,$(location.attr('href'));
$(窗口).on('popstate',函数(){
$(“#lblMessage”).html(“Onpopstate”);
如果(!confirm('browsed back?'))
window.history.pushState(null,null,$(location.attr('href'));
其他的
window.history.back();
});
}
});
地位
我创建了一个测试站点。我认为这与