Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The basic of them all is this: <a href="http://www.w3schools.com/js/js_window_navigator.asp" rel="nofollow">w3school JS</a>.</p> <p>Code: </p> <pre><code>&lt;script&gt; txt = "&lt;p&gt;Browser CodeName: " + navigator.appCodeName + "&lt;/p&gt;"; txt+= "&lt;p&gt;Browser Name: " + navigator.appName + "&lt;/p&gt;"; txt+= "&lt;p&gt;Browser Version: " + navigator.appVersion + "&lt;/p&gt;"; txt+= "&lt;p&gt;Cookies Enabled: " + navigator.cookieEnabled + "&lt;/p&gt;"; txt+= "&lt;p&gt;Platform: " + navigator.platform + "&lt;/p&gt;"; txt+= "&lt;p&gt;User-agent header: " + navigator.userAgent + "&lt;/p&gt;"; txt+= "&lt;p&gt;User-agent language: " + navigator.systemLanguage + "&lt;/p&gt;"; document.getElementById("example").innerHTML=txt; &lt;/script&gt; </code></pre> <p>But this is not sure about -webkit-. </p> <p>Here is a fiddle for that, I mean a fiddle for the -webkit- browser alert! (For Chrome, Safari only; Opera 15+ not supported yet!) <a href="http://jsfiddle.net/oscarj24/DJ349/" rel="nofollow">jsfiddle.</a></p> <p>Here is a jQuery code, for this! try this:</p> <pre><code>$(document).ready(function(){ /* Get browser */ $.browser.chrome = /chrome/.test(navigator.userAgent.toLowerCase()); /* Detect Chrome */ if($.browser.chrome){ /* Do something for Chrome at this point */ /* Finally, if it is Chrome then jQuery thinks it's Safari so we have to tell it isn't */ $.browser.safari = false; } /* Detect Safari */ if($.browser.safari){ /* Do something for Safari */ } }); </code></pre> <p>This will show a popup, as soon as the windows loads!</p> <p>The best and easy and readable solution would be this: </p> <pre><code>$.browser.chrome = $.browser.webkit &amp;&amp; !!window.chrome; $.browser.safari = $.browser.webkit &amp;&amp; !window.chrome; if ($.browser.chrome) alert("You are using Chrome!"); if ($.browser.safari) alert("You are using Safari!"); </code></pre> <p>These were the basics, that I found on some sites:</p> <ol> <li><a href="http://w3schools.com" rel="nofollow">w3schools.com</a></li> <li><a href="http://stackoverflow.com">stackoverflow</a> (I used this site to find fiddles.</li> </ol>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload