简体   繁体   中英

Detect IE browser and open the same url using chrome browser

I am using WordPress to build a project. After adding a nice theme template, it looks nice using google chrome browser, however when using IE browser, some of the feature does not shown up. So I was wondering is there some methods that could detect if user using IE browser and it could automatic open chrome and browse the same URL(saying all our user install chrome already), and close IE.

Or is there any other approach to this problem?

You can't and shouldn't do this.

JavaScript should not have access to the user's system, and also this is a terrible UI feature if it could be implemented.

A better way to handle this is:

  1. Detect IE and show some sort of alert that suggests they use a different browser
  2. Make your website compatible with IE to the extent that you feel comfortable

Best thing to do, if you gone to far into the project is to use different stylesheet for IE:

<!--[if IE]>
  <link href="IE-styles.css" />
<![endif]-->

Or, if there is a problem with specific version of IE use: (Targeting IE8, and older)

<!--[if lt IE 9]>
    <link rel="stylesheet" type="text/css" href="ie8-and-down.css" />
<![endif]-->

Hope this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM