ios Javascript history.go(-1) 不适用于 ios 10.2.1 中的 Safari



>我使用 php 检查电子邮件格式并使用 Javascript 发出警报,但我使用 history.go(-1( 它在 url/undefined 中重定向

这是我的代码

if (!filter_var($mail, FILTER_VALIDATE_EMAIL)) {
$message = "Email format not true";
echo "<script type='text/javascript'>alert('$message');window.location = history.go(-1); </script>";
}

感谢您的帮助

window.location = history.go(-1);

错了。它应该是:

window.history.go(-1);

最新更新