How would I go about this;
I want anybody who visits my site to get a pop-up if they're not using Google Chrome.
Is the code simple?
Cheers

How would I go about this;
I want anybody who visits my site to get a pop-up if they're not using Google Chrome.
Is the code simple?
Cheers
I suck at javascript, but this seems to work (haven't tested it in all browsers though):
Code:if (!navigator.userAgent.indexOf("Chrome")) { alert("Alert text here"); }
If you are using a framework such as jQuery you can do statements such as:
More info here: http://api.jquery.com/jQuery.browser/HTML Code:<script type="text/javascript"> //$.browser.msie; //$.browser.mozilla; //$.browser.webkit; //$.browser.opera; if( $.browser.webkit ) { alert( 'This is a webkit based browser. IE: Chrome, Safari' ); } </script>
Otherwise here's a slightly different version of Trinitys code that I would use:
and then obviously check it has found it etcHTML Code:navigator.userAgent.toLowerCase().indexOf("chrome");![]()
Want to hide these adverts? Register an account for free!