본문 바로가기

webdesign/JavaScript

Detect Internet Explorer and display a message

 

https://stackoverflow.com/questions/14544816/detect-internet-explorer-and-display-a-message

 

Detect Internet Explorer and display a message

I have been looking around and cannot find what I am looking for I want to display a warning to IE users that my website does not support IE nor will it ever try to and that you should get a better

stackoverflow.com

<!--[if lt IE 7]>
    <p class="chromeframe">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">activate Google Chrome Frame</a> to improve your experience.</p>
<![endif]-->

Conditional HTML comments will work for detecting IE9 or less.

 

 

<script>
  var x = navigator.userAgent;
  alert(' browser details ' + x);
</script>

navigator object has all details related to browser and platform details of clients machine.

navigator.userAgent gives browser related details.

Below link talks at length about it in detail :

http://www.javascriptkit.com/javatutors/navigator.shtml

 

 

 if ($.browser.msie) {
    // you are using IE
 }

More detail : jquery.browser

 


https://techstacker.com/detect-internet-explorer-react-display-message/

 

How to Detect Internet Explorer (or any Browser) With React and Display a Message to Visitors

One of my clients recently had a rare visitor from Internet Explorer 11, which according to our analytics happens around 0.2% of the time…

techstacker.com

 


vs. 

How to restrict portal to IE only, display error message to user if Firefox

 

One way to acheive this is to customize your login page and add a script to detect the browser and act accordingly.

For customizing the Loginpage, you can find weblogs or pdfs on sdn or refer the thread :

https://www.sdn.sap.com/irj/sdn/thread?threadID=135809&messageID=1519172 How to change the login page of EP ?

 

Once you have the logonpage.jsp file, Add the following lines to it in the script block where you find the js functions clearEntries() and setFocusToFirstField().

if(navigator.appName != 'Microsoft Internet Explorer')
{
window.location='http://www.google.co.in';
}

In place of the Google url, give the url of the page to which you want to redirect. Add these lines as the first lines in that script block.

Then build the par file and upload it to the server. Follow the instructions to change the login page in the authschemes.xml file.

 

 


example of usage : 

https://note2self.tistory.com/entry/outlook-email-rendering-issues?category=971710 

 

outlook email rendering issues

elasticemail.com/blog/transactional_email/email-rendering-issues-in-outlook-and-hacks-to-save-the-day Email Rendering Issues in Outlook and Hacks to Save the Day With a plethora of email clients ava..

note2self.tistory.com