IPhone8 phone does not respond to formData operation, why?

nothing pops up on the iPhone8 phone. Why?

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
  <button id="btn">click me</button>
  <script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
  <script>
    $("-sharpbtn").on("click", function() {
      var formdata = new FormData();
      formdata.set("key", "value");
      alert(formdata.get("key"));
    });
  </script>
</body>
</html>
Mar.18,2021

have you tried other phones?


safari does not allow users to alert
you can try to put a button click after alert


write in a click event to see the pop-up


Sunian, have you solved the problem? I'm also stuck in this


some iPhones have only one append method for sessionStorage, no get and no set, but can only append and submit directly

.
Menu