Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/424.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/191.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Benalman Js不能在Ipad上工作。杂凑变化_Javascript_Android_Jquery_Ios_Ipad - Fatal编程技术网

Javascript Benalman Js不能在Ipad上工作。杂凑变化

Javascript Benalman Js不能在Ipad上工作。杂凑变化,javascript,android,jquery,ios,ipad,Javascript,Android,Jquery,Ios,Ipad,我使用返回按钮控制窗口重定向url到主页 我在普通浏览器和安卓手机上进行了测试,它可以正常工作。 但它在Ipad上不起作用 这是代码的一部分 <!DOCTYPE html> <html> <meta name="viewport" content="width=device-width, initial-scale=1"> <script src="jquery.min.js"></script> <script src="jqu

我使用返回按钮控制窗口重定向url到主页

我在普通浏览器和安卓手机上进行了测试,它可以正常工作。 但它在Ipad上不起作用

这是代码的一部分

<!DOCTYPE html>
<html>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="jquery.min.js"></script>
<script src="jquery.ba-hashchange.min.js"></script>
<script>
// control back button
    // includes in js mean contains 
    if(!window.location.href.includes('#state')){
        history.pushState(null ,document.title, '#state'); // forwards
    }

    // Bind an event handler.
    jQuery(window).bind('hashchange', function(e) {
        window.location = _contextPath + "/home/";
    });
</script>
 </html>

//控制返回按钮
//包含在js平均包含中
如果(!window.location.href.includes('#state')){
history.pushState(null,document.title,#state');//转发
}
//绑定事件处理程序。
jQuery(window).bind('hashchange',函数(e){
window.location=_contextPath+“/home/”;
});
我注意到,在Ipad中,url不会附加“#state”。 我怀疑history.pushState在Ipad中不起作用

我怎样才能解决这个问题


谢谢

我换衣服后问题解决了

includes

与Benalman Js库无关。可以排除此js

多谢各位

indexOf