//判断设备类型 var u = navigator.userAgent, app = navigator.appVersion; var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1; // var isIOS = !!u.match(/(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端 if (isAndroid) { //点击返回键 $("#goBack").click(function () { window.history.back(); }) } else if (isIOS) { // alert("isIOS"); iosGoBack(); } else { } https://blog.csdn.net/weixin_37806077/article/details/84939337