Posts

Showing posts with the label safari

Array state will be cached in iOS 12 Safari. Is it a bug or feature?

I found a problem with Array's value state in the newly released iOS 12 Safari, for example, code like this: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"> <title>iOS 12 Safari bugs</title> <script type="text/javascript"> window.addEventListener("load", function () { let arr = [1, 2, 3, 4, 5]; alert(arr.join()); document.querySelector("button").addEventListener("click", function () { arr.reverse(); }); }); </script> </head> <body> <button>Array.reverse()</button> <p style="color:red;">test: click button and refresh page, code:</p> </body> </html> After refreshing the page, the array's value is stil...

Array state will be cached in iOS 12 Safari, is bug or feature?

Today I found some problem of Array's value state in the newly released iOS 12 Safari, for example, code like this: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"> <title>iOS 12 Safari bugs</title> <script type="text/javascript"> window.addEventListener("load", function () { let arr = [1, 2, 3, 4, 5]; alert(arr.join()); document.querySelector("button").addEventListener("click", function () { arr.reverse(); }); }); </script> </head> <body> <button>Array.reverse()</button> <p style="color:red;">test: click button and refresh page, code:</p> </body> </html> After refreshing the page, the array's value is still reversed. Is this a bug or a feature of new Safari? ...