Skip to content Skip to sidebar Skip to footer

How Can I Redirect To IE From Other Browsers?

I want to redirect to Internet Explorer from other browsers by JavaScript. How can I do that?

Solution 1:

You can't.

In a standard security context, browsers provide no way of launching other programs (and a goodly number of systems don't have Internet Explorer anyway). In non-standard security contexts, most browsers still don't provide a way of launching other programs.


Solution 2:

JavaScript does not allow you to execute programs (like Internet Explorer) from another web browser. This isn't possible.

I would recommend to either:

  • Show an error/warning that the site doesn't work or might not work correctly when not using IE
  • Fix the site to work cross-browser (recommended)

Solution 3:

Short answer is that you can't.

The real reason is security, which will (hopefully) always prevent you from running applications on the user's computer, but even if there weren't for that reason... I'm sorry, I just have to nitpick a bit here. What you're trying to do should be absolutely unacceptable in no uncertain terms to every single user and developer. I think I can safely speak for the overwhelming majority of experienced web developers, that techniques designed to dictate to the user which browser to use are always, always, always wrong, not just technically but morally. Yes, I used the M-word. It's immoral to make those sorts of decisions for your users, no matter how dumb they are. Warn them if your site is designed specifically for a particular browser, that's fine, but don't make the actual decision for them.

Sorry, I know this ain't the place for arguing, but I do believe this needs to be clear because it's a real problem in web development that really does waste time and really does cost money and really does harm the web as a whole.

So as far as I'm concerned, I'm glad these security measures are there, because this is an extraordinarily bad idea in the first place, even without the security risks.

No disrespect intended. It just had to be said.


Solution 4:

You can't and you shouldn't!

However, this simple javascript, which only works in IE6, can runs firefox.exe from C:\Program Files\Mozilla Firefox ( YES I KNOW IT CAN BE SOMEWHERE IN E: OR D: .... but as I know the default path of Firefox is C:\Program Files\Mozilla Firefox ... you can complete this script and find the correct path of firefox.exe)

This HELL script shows that IE6 is really insecure. ( of course it shows a warning message )

You should never 'FORCE' visitors using your favorite browser. Never ever use such script, this is just for demonstration purpose.

<html>

<head>

<SCRIPT Language="JScript">
   function runFirefox() {
   File="c:\\PROGRA~1\\MOZILL~1\\FIREFOX.EXE http://stackoverflow.com"; 
   WSH=new ActiveXObject("WScript.Shell");
   WSH.run(File);
 }
</SCRIPT> 

</head>

<body onLoad="javascript:runFirefox();">
   <b>For the best experience we FORCE you using Firefox.</b> 
</body>

</html> 

Solution 5:

You should just develop websites that are viewable in all common browsers ;). No work-arounds for people using different browser types / version. When developing websites just make sure you meet the standards and all websites have sheets for the common browsers.


Post a Comment for "How Can I Redirect To IE From Other Browsers?"