1. Problems with ios
1. Date
The time format yyyY-MM-DD hh:mm: SS is processed in the browser when the ios system does not recognize time formatting, but becomes NAN or NULL on the mobile phone. In this case, the ios system cannot convert this type of time.
let date = new Date('2019-02-28 18:33:24'); // null
Copy the code
Replace (/-/g, “/”) replace(/-/g, “/”)
2. Replication problem
function copy(txt) { const input = document.createElement('input'); input.setAttribute('readonly', 'readonly'); // Input set to read-only, ios will not pull up the keyboard input.setattribute ('value', TXT); document.body.appendChild(input); if (input.select()) { input.select(); } else { input.setSelectionRange(0, 9999); } if (document.execCommand('copy')) {document.execCommand('copy'); } input.style.display = 'none'; document.body.removeChild(input); }Copy the code
Second, the problems of Android system
1, the bottom bottom fixed positioning, Android keyboard caused by page deformation how to solve? (The bottom is fixed positioning. When the Android terminal gets the focus in the Chinese text box input of the page, the keyboard of the mobile phone will be aroused and pop out to be pushed up by the keyboard, floating above the keyboard)
In Android, when the soft keyboard is up or down, it will change the height of the window, so listen for the onresize event of the window, when the keyboard is up,
/ / get the height of the original window var originalHeight = document. The documentElement. ClientHeight | | document. Body. ClientHeight; Window. Onresize = function () {/ / key up and hidden will change the height of the window var resizeHeight = document. The documentElement. ClientHeight | | document.body.clientHeight; If (resizeheight-0 < originalheight-0){ Operations/here/to fixed location into a relative positioning setTimeout (function () {/ / some can use this method e. arget. ScrollIntoView (true) e. arget. ScrollViewIfNeeded ()}, 100)}else{// When the soft keyboard is down, operate here // change relative positioning to fixed positioning}}Copy the code
Reference: Summarized several mobile terminal H5 soft keyboard pit and its solution