How can I get browser to prompt to save password?

前端 未结 20 1447
面向向阳花
面向向阳花 2020-11-22 16:20

Hey, I\'m working on a web app that has a login dialog that works like this:

  1. User clicks \"login\"
  2. Login form HTML is loaded with AJAX and displayed i
20条回答
  •  日久生厌
    2020-11-22 16:45

    I spent a lot of time reading the various answers on this thread, and for me, it was actually something slightly different (related, but different). On Mobile Safari (iOS devices), if the login form is HIDDEN when the page loads, the prompt will not appear (after you show the form then submit it). You can test with the following code, which displays the form 5 seconds after the page load. Remove the JS and the display: none and it works. I am yet to find a solution to this, just posted in case anyone else has the same issue and can not figure out the cause.

    JS:

    $(function() {
      setTimeout(function() {
        $('form').fadeIn();
      }, 5000);
    });
    

    HTML:

提交回复
热议问题