Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open in IE

Status
Not open for further replies.

at51178

Technical User
Mar 25, 2002
587
US
Hey guys


I am some what new to javascript so this might be an easy question

I would like to create a website where if you are using netscape or netscape is your default browser that when you open the webpage that it opens what in Internet explorer no matter what.

Please let me know if this can not be done thank you
 
>Please let me know if this can not be done thank you.

Sorry, you can't. Javascript is not meant to control applications on a person's computer for security reasons. Basically it can only mess with stuff on the current webpage you are viewing.

As other people would say, you can image if webpages all the sudden changed your browser or setup a different default browser.
 
Well I am not asking it to change th default browser of the computer to IE

I guess what I am looking for is something like a redirect script I know I have seen it somewhere where if you click on a link depending on what browser you are using it will redirect you to that link son what I am looking for is something similar to that but I would like to set it up as an onload script so that when the page loads up and you are in navigator it will automatically open the same page in ie and close the current page in netscape. I think it can work out with an if statement but I am not sure what to add in the if statement.


 
I agree with KevinAr18. I don't think you can open other applications from javascript. You can't even mess around that much with the browser that the page is loading into (although you can a little bit)
 
This is almost correct, you can open a version of IE for the user if they are using netscape, but you have to open it from the server, which will kill any modem people, result in license infringement, and all sorts of goodies like that. I spent a good deal of time trying to find a way to do this, the easiest (and basicaly only) way to do this is to ask your user very nicely to open IE.
-tarwn ------------ My Little Dictionary ---------
Reverse Engineering - The expensive solution to not paying for proper documentation
 
I understood what you meant. Let me see if I can explain a little better what I said.

Javsacript is not meant to know anything about files on your own computer. The most javascript can know about your computer is details the browser provides it. This includes things like cookies, browser information, and even security holes/vulnerabilities.

Your request about changing browsers requires Internet Explorer to be launched (opened). Since javascript cannot touch ANY applications on anyone's computer, it cannot launch IE.
(Note: There is currently a security vulnerability in IE allowing javascript to launch applications on a person's computer. However, this is not something I'd suggest using. In addition, I believe Norton Antivirus considers any files using this vulernability to be infected.)

This may not fit within your scheme of things, but you might be able to make a shortcut that the user could download and put on their computer that would launch the page in IE.

On my site I had a very special section that required the user to have IE 5.5 or higher, so I made a script that would detect if the person had IE 5.5 or higher. If they didn't they could't get in and it would display a message telling them that they needed IE 5.5 or higher and give a link to where they could download it. If they had IE 5.5 or higher it would open the page in a new window.

Well, there's a few ideas. Hope that helps. BTW, I'd be curious to see the page. Perhaps it could at least be made to work in Mozilla/NS6? Even if it can't, I'd be interested in seeing it still.
 
Hey Kev


Thanks for answering back the thing with the network that I help run is that it is locked down and some of the scripts that I use in IE do not work in navigator my company set the computers up so that navigator is the default in order to open the intranet website I had to put the site on their favorites list so when the users want to bring up the site they have to lanch their IE explorer and go to their favorites but I think that is the long way to do it.


I like the shortcut Idea and me and my technicians have tried it out and it still defaults to navigator. is there any way I could make it default to IE by setting up a shortcut on the desktop.

I am not sure if I am asking the same question again and I know that you know what my problem is but I thought that there would be a way around it. Thanks for all the help.
 
Yup, it's possible with a shortcut.

Here's what you do.

Make or copy one of the shortcuts to Internet Explorer (on each computer).

Then right click on the shortcut and go into the properties.

For the Target it should look something like this:
"C:\Program Files\Internet Explorer\IEXPLORE.EXE"

Change it to this

"C:\Program Files\Internet Explorer\IEXPLORE.EXE"
Notice all I did was after the last quotation mark, add a space and then the URL of the webpage that I want it to go to.

At this point you can rename the shortcut to whatever you want and/or change the icon and other stuff if you like.

Basically what it does it launch internet explorer but with the command line option to have it launch with a certain page. I got this idea based on something I read elsewhere that told you how to set up IE so it launches with nothing showing (to speed up launch time a little).


There is a problem with this - as you can see the shortcut uses an absolute URL to Internet Explorer. For that reason you might not be able to creat just one shortcut and put it on all computers since they may have IE installed in different places. Then again, there's a good possibility all of them have IE intalled in the same place so....

If this is a problem or if you know a better solution post again.
 
Another thing you could do (but probably don't want to) is make a copy of your code and edit it so it works on NS. Then use a browser detection script to determine which version of your code to run. Something like:
Code:
var ie=(document.all?true:false)
var ns=(document.layers?true:false)
if(ie){
  //put your ie code here
}
else if(ns){
  //put your ns code here
}
else{
  alert('You must be using either Netscape 4.0+ or Internet Explorer 4.0+')
}
 
Hey Kevin


I tried doing what you told me I typed in the target in the shortcut html and then I typed in a wb address and it worked great but when I type in my intranet site it opened up the folder where the file is located. this is what I typed in tell me if I am doing anything wrong.

"C:\Program Files\Internet Explorer\IEXPLORE.EXE"
thanks
 
sorry that should of been

"C:\Program Files\Internet Explorer\IEXPLORE.EXE" file://j:/Qupid/index.htm
 
This works:
%SystemRoot%\explorer.exe c:\windows
This also works:
"C:\Program Files\Internet Explorer\IEXPLORE.EXE" c:\windows
Notice one is explorer.exe (what is normally Windows Explorer)
The other is iexplore.exe (what is normally Internet Explorer)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top