my code stock.com

Dustin Falgout

Detect Samsung Android
by Dustin Falgout

Detect Old Samsung Browser

Snippet options

Download: Download snippet as detect-samsung-android.html.
Copy snippet: For this you need a free my code stock.com account.
Embed code : You will find the embed code for this snippet at the end of the page, if you want to embed it into a website or a blog!

<script>
(function($) {
    function whichAndroidV() {
    var userAgent = navigator.userAgent.toLowerCase(); 
    var check = userAgent.match(/android\s([0-9\.]*)/);
    return check ? check[1] : false;
}
$(document).ready(function() {
    

if(navigator.userAgent.match(/SAMSUNG|SGH-[I|N|T]|GT-[I|P|N]|SM-[N|P|T|Z]|SHV-E|SCH-[I|J|R|S]|SPH-L/i))  {
    var version = whichAndroidV();
    if(false !== version && parseFloat(version) <= 4.3) {
        
    alert("YOUR ALERT MESSAGE HERE");
    
    }
}
});
})(jQuery);
</script>

Create a free my code stock.com account now.

my code stok.com is a free service, which allows you to save and manage code snippes of any kind and programming language. We provide many advantages for your daily work with code-snippets, also for your teamwork. Give it a try!

Find out more and register now

You can customize the height of iFrame-Codes as needed! You can find more infos in our API Reference for iframe Embeds.