Streaming live at 10am (PST)

Display message for old browsers


#1

Hello people,

So as most of us know internet explorer doesn’t support a lot of the ‘modern’ code and displays a lot of websites incorrectly. I don’t have a lot of visitors using internet explorer but it does occur and I’d like to display a message to these users.

So the question is: How do I display a message/pop-up for people using internet explorer only?

Ideally I’d like to simply have a div block’s display values change if internet explorer = true.

Cheers,
Emil S


#2

According to https://stackoverflow.com/a/22242528/584192,

if(navigator.userAgent.indexOf('MSIE')!==-1 ||
    navigator.appVersion.indexOf('Trident/') > 0)
{
    // do something here ...
}

#3

For anyone reading this looking for a solution:

<script type="text/javascript">
    if(navigator.appName.indexOf("Internet Explorer")!=-1 || navigator.userAgent.match(/Trident.*rv[ :]*11\./))
    {
       //This user uses Internet Explorer
       window.location = "https://www.yourlinkhere.com";
    }
    </script>