ZulfadlyAshBurn Posted May 7, 2011 Share Posted May 7, 2011 I need help. I would like to have a script that would detect if the browser used is chrome. If browser is chrome then show div. This is the script i have now! <script> var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome'); if (is_chrome > 1) { alert('Best viewed in Google Chrome!') } else{ alert('Best viewed in Google Chrome') } </script> Quote Link to comment https://forums.phpfreaks.com/topic/235763-check-if-browser-is-chrome/ Share on other sites More sharing options...
ZulfadlyAshBurn Posted May 7, 2011 Author Share Posted May 7, 2011 The code is working. Just realised that on my script i added ";" to the end of the alert. Im much of a php coder. teehee Quote Link to comment https://forums.phpfreaks.com/topic/235763-check-if-browser-is-chrome/#findComment-1211902 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.