简体   繁体   中英

How to create a "does not support safari" on my website?

I am doing a project for my school and realized that safari visualizes buttons and so on differently, so I decided not to include safari.

Does anyone know how I make make an alert that shows that the website is not optimized for safari? (once it notices it is on safari)

Thank you!

You can use the is library to check the browser type http://is.js.org/#safari

 if (is.safari()) { alert("This site does not work on safari"); } else { console.log("Not safari"); }
 <script src="https://cdnjs.cloudflare.com/ajax/libs/is_js/0.9.0/is.min.js"></script>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM