简体   繁体   中英

ios Javascript history.go(-1) not work for Safari in ios 10.2.1

I use php to check email format and use Javascript to alert but I use history.go(-1) it redirect in url/undefined

this is my code

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>";
}

thanks for all your help

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

Is wrong. It should be:

window.history.go(-1);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM