像素比和pageshow事件

Tutorial: DOM操作 Category: JS Published: 2026-04-07 13:58:26 Views: 20 Likes: 0 Comments: 0

像素比和 pageshow 事件.md

<!DOCTYPE html>
<html lang="en">
  <head></head>

  <body>
    <script>
      console.log(window.devicePixelRatio);

      window.addEventListener("pageshow", function () {
        alert(11);
      });
    </script>

    <a href="http://www.itcast.cn">链接</a>
  </body>
</html>