Re: Browser redirection
by George_Sherston (Vicar) on Mar 01, 2002 at 16:59 UTC
|
When I have got to the stage of worrying about which browser the user is using to look at my stuff, I've normally taken this as a sign I took a wrong turning a few miles back, and have re-traced my steps. I think there are very few things worth doing (possible exception, some javascript fancy-pants stuff) that can't be done in a browser-neutral way; and in fact, my (admittedly limited) experience is that finding the browser-neutral way is also a way to boil my code down to something more elegant and simple.
§ George Sherston | [reply] |
Re: Browser redirection
by mull (Monk) on Mar 01, 2002 at 14:34 UTC
|
I'm pretty sure that you wouldn't want to be able to do that from javascript either. Javascript runs in the client's browser, so you shouldn't be able to escape to execute some other app. If you could get IE to open from Netscape, that would basicly also allow you to execute anything you wanted to on the visitor's computer!
And what if your visitor doesn't have IE ? There are people browsing the web on their cell phones these days...
When people talk about browser redirection, they are mostly describing the use of CGI to detect the useragent and redirect the visitor to a site customized for that browser. You could detect old browsers and send them to a plain text layout, and send more up-to-date browsers to your CSS & Javascript extravaganza. You wouldn't even have to code the pages twice if you used some sort of templating system to generate the pages for you.
| [reply] |
Re: Browser redirection
by thunders (Priest) on Mar 01, 2002 at 15:37 UTC
|
ok I'm going to avoid the rant that I would usually go off on where I hee and haw about coding cross-browser compliant HTML, and explain that even with a redirect there are several other browser on the market besides the big two.
Also I'm going to assume that you do not want to actually open one browser from another, you just want to send the user to the netscape or IE version of the page, right?
if you are using CGI.pm look up user_agent()and redirect() in perldoc CGI | [reply] [d/l] |
Re: Browser redirection
by Anonymous Monk on Mar 02, 2002 at 08:17 UTC
|
| [reply] |
Re: Browser redirection
by higle (Chaplain) on Mar 01, 2002 at 14:37 UTC
|
Are you asking whether it is possible to open an IE browser from within a script running in a Netscape browser? (no, that is not possible with Perl or CGI, nor is such user system hijackery recommendable in any case)
Or, are you asking about location redirection, i.e. redirecting a user with a Netscape browser to the Microsoft IE website for a download? Yes, this is possible with Perl, but making the user wait for a server-side script to execute for this is not recommendable, either.
Sounds like you're looking for JavaScript...
higle | [reply] |
|
|
Thanks for all the replies.
Yes, I want something that will take me from a Netscape page to
a IE page. No downloads just a link on the web page using Netscape browser that will redirect to a specific
page in IE browser.
| [reply] |
|
|
Ok, the reason something like that is not possible, is because that involves making a call to the users system. If you could open explorer from a cgi, what's to stop you from running rm -rf / or format c: or some other nasty system call.
I suppose if you are targetting a browser that supports ActiveX you could prompt your user to accept a control that could do something like that. But such an operation, cannot and should not be carried out automatically from a CGI.
| [reply] [d/l] [select] |
Re: Browser redirection
by particle (Vicar) on Mar 01, 2002 at 13:55 UTC
|
you can't do this from the server-side. you'll have to use javascript.
Update what the heck was i thinking? i should eat breakfast before answering my first question of the day.
~Particle ;Þ
| [reply] |