Freigeben über


Check your Internet explorer version for SharePoint 2013 sites using simple javascript

Hello

In this blog we will see how to identify and alert users who access SharePoint 2013 site from IE7 and below.

Step 1. On your SharePoint page, add a Script editor web part as below


 
  
  
Step 2. From web menu -> Edit the web part properties that will enable EDIT SNIPPET button. Click the EDIT SNIPPET to add script logic.

Step 3.  Embed the below script in the dialog window

<script type="text/javascript">

if(navigator.appName.indexOf("Internet Explorer")!=-1){

    var ieBrowser=(navigator.appVersion.indexOf("MSIE 8")==-1 && navigator.appVersion.indexOf("MSIE 9")==-1 &&  navigator.appVersion.indexOf("MSIE 1")==-1);

 if(ieBrowser)

  {

      alert('Upgrade to IE8 and above');

  }

}

 </script>

 

 

Step 4. Click on Insert and close the web part property window by applying the changes.

 

To Test

From the developer tool (hit F12) on IE browser, change IE7 and refresh the page.

 

 

Now, you see a tiny alert window saying Update to IE 8 and above

 

 

Hope this was useful.

 

Cheers :)

Raghav

Comments

  • Anonymous
    September 16, 2013
    Cheers! This was exactly what I was looking for.

  • Anonymous
    January 06, 2015
    browseris.ie and browseris.ie8up and browseris.iever They come from init.js in SP 2013.

  • Anonymous
    January 06, 2015
    Sorry, browser.ie8up should have been browseris.ie8standardsUp. Or simply browseris.iever >=8