Vern,

Your question threw me, a little. I wasn't sure if you wanted to test from a CGI program, or from JavaScript. I reread your message and concluded that you wanted to test from JavaScript, and the first thing that came to mind was that there are quite a few elements in the IE DOM that aren't in the GECKO DOM and you can check for their existence with an if statement. For example, using Javascript:

if (window.event) ... returns true under IE but false under GECKO.

And there are a bunch of similar examples where an element or method is found under one DOM but not another.

The only way I know to test from a CGI program is through the HTTP_USER_AGENT environment variable. But Aaron messed with my brain by suggesting that a Firefox plugin could change the header settings. Wow, what a dirty trick on Web developers!

Nathan.






----- Original Message ----
From: "vhamberg@xxxxxxxxxxx" <vhamberg@xxxxxxxxxxx>
To: web400@xxxxxxxxxxxx
Sent: Wednesday, July 30, 2008 7:17:25 AM
Subject: [WEB400] Need advice on reliable way to identify IE as the browser

Have a CGI app that builds a page with some Javascript - it can try to use an ActiveX object, but, of course, that is invalid in Firefox - or at least I will treat it as such.

I've looked at some ways to know that the browser is IE - UserAgent I think is one but things like Opera can make themselves look like IE for part of it.

The use of the ActiveX object involves a javascript:void that calls a function. That function tries to execute a function in the ActiveX object. I have tried a try-catch around the javascript:void but am seeing - doh - that there will never be an error at that point that I can respond to - or is there?

In firefox, the call to the ActiveX function does generate an error, but it's buried in the javascript:void.

So what are my options? Back to useragent or whatever it's called? - have to check google again. Or is there a way to check some error back where I use the javascript:void?

Or something else!!

Thanks
Vern

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.