473,696 Members | 1,955 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

things missing from the FAQs: which browser is this

How is it possible that the question "How do I detect which browser
the user has" is missing from this FAQ:

http://www.faqts.com/knowledge_base/index.phtml/fid/125

and is only here on this with a link to old information that suggests
use of "navigator" :
http://developer.irt.org/script/43.htm
Jul 23 '05 #1
17 2551
Lee
lawrence said:

How is it possible that the question "How do I detect which browser
the user has" is missing from this FAQ:

http://www.faqts.com/knowledge_base/index.phtml/fid/125

and is only here on this with a link to old information that suggests
use of "navigator" :
http://developer.irt.org/script/43.htm


Because it's generally a bad idea to try to guess which browser
the user has. That's rarely useful information. Different
versions of the same browser may be very different, and the same
version may behave differently on different platforms or with
different user preferences. The navigator attribute can't be
trusted even to reliably report the browser name.

It's better to detect whether or not the browser your code is
running in supports whatever specific features you're interested
in.

Jul 23 '05 #2
In article <da************ **************@ posting.google. com>,
lk******@geocit ies.com enlightened us with...
How is it possible that the question "How do I detect which browser
the user has" is missing from this FAQ:

http://www.faqts.com/knowledge_base/index.phtml/fid/125


Browser detection for anything other than IE using the proprietary IE
conditional code is bound to fail horribly.
They should have that question there with all the reasons why one *shouldn't*
do it.

No one with any experience does browser detection any more. That's a
throwback from the days when only IE and Netscape were around.
Use object detection instead.

--
--
~kaeli~
Murphy's Law #2030: If at first you don't succeed, destroy
all evidence that you tried.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #3
On Fri, 1 Oct 2004 09:01:19 -0500, kaeli wrote:
Use object detection instead.


<testing recently gained knowledge>
The term 'object detection' should really be changed to
'feature detection', as to say 'object detection' without
qualification leads to confusion between 'feature detection'
and 'object inference'* ( which is a bad thing, ..mmkay? ;-).
</testing recently gained knowledge>

*
<http://google.com/groups?q=object +inference&grou p=comp.lang.jav ascript>

--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.lensescapes.com/ Images that escape the mundane
Jul 23 '05 #4
On Fri, 01 Oct 2004 15:09:59 GMT, Andrew Thompson <Se********@www .invalid>
wrote:

[snip]
<testing recently gained knowledge>
The term 'object detection' should really be changed to
'feature detection', as to say 'object detection' without
qualification leads to confusion between 'feature detection'
and 'object inference'* ( which is a bad thing, ..mmkay? ;-).
</testing recently gained knowledge>


I'd agree that it's a better term. Feature detection applies to testing
the presence - and possibly the behaviour - of objects, methods and
properties. Object detection seems more limited in scope.

[snip]

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #5
In article <opse659ucvx13k vk@atlantis>, M.******@blueyo nder.co.invalid
enlightened us with...
On Fri, 01 Oct 2004 15:09:59 GMT, Andrew Thompson <Se********@www .invalid>
wrote:

[snip]
<testing recently gained knowledge>
The term 'object detection' should really be changed to
'feature detection', as to say 'object detection' without
qualification leads to confusion between 'feature detection'
and 'object inference'* ( which is a bad thing, ..mmkay? ;-).
</testing recently gained knowledge>


I'd agree that it's a better term. Feature detection applies to testing
the presence - and possibly the behaviour - of objects, methods and
properties. Object detection seems more limited in scope.

[snip]


Can one of you lovely gentlemen explain the difference please?

I know what *I* meant, but I'm not sure what you all mean. *smiles*

Is this object or feature detection:

if (document.getEl ementById)
{
e = document.getEle mentById("myDiv ");
if (e.style.visibi lity)
{
e.style.visibil ity = "hidden";
}
}

To me, it's object detection, since I'm testing for objects and properties of
objects.
Feature detection seems too much like looking for plugins, to me, anyways. If
someone said "Feature detection", I'd think of Flash and applets, not DOM.
Could be my bad, though. My brain breaks now and then.

--
--
~kaeli~
Once you've seen one shopping center, you've seen a mall.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #6
On Fri, 1 Oct 2004 13:35:51 -0500, kaeli <ti******@NOSPA M.comcast.net>
wrote:
In article <opse659ucvx13k vk@atlantis>, M.******@blueyo nder.co.invalid
enlightened us with...
On Fri, 01 Oct 2004 15:09:59 GMT, Andrew Thompson
<Se********@www .invalid> wrote:
<testing recently gained knowledge>
The term 'object detection' should really be changed to
'feature detection', as to say 'object detection' without
qualification leads to confusion between 'feature detection'
and 'object inference'* ( which is a bad thing, ..mmkay? ;-).
</testing recently gained knowledge>
I'd agree that it's a better term. Feature detection applies to testing
the presence - and possibly the behaviour - of objects, methods and
properties. Object detection seems more limited in scope.


Can one of you lovely gentlemen explain the difference please?


We're not being too pedantic, are we? :P
I know what *I* meant, but I'm not sure what you all mean. *smiles*
We all mean the same thing. :)

The debate here is that the phrase, object detection, seems too much like,
object inference. The latter being a form of browser detection which uses
one or more objects that the author thinks is unique to a browser (and
usually isn't).
Is this object or feature detection:
I'd call it feature detection because you're not just looking at objects.
I also think it gives the clear indication that you're looking at the user
agent's capabilities.
if (document.getEl ementById)
{
e = document.getEle mentById("myDiv ");
if (e.style.visibi lity)
I assume that this was a quick example, but I thought I'd mention that
that test might fail even when the visibility property is supported.
That's because the value could be an empty string, indicating that there
is no inline style in effect, and evaluate as false. Moreover, is misses a
crucial test: is the style object supported?

I'd write:

if(e && e.style) {

If that test passes, you can write to the visibility property. Nothing may
actually happen when you do so, but you can't really tell if it would,
anyway. If you did want an explicit check for the property, add

&& ('string' == e.style.visibil ity)

By this point, it might be worth saving a reference to the style object to
reduce look-ups.

[snip]
To me, it's object detection, since I'm testing for objects and
properties of objects.
Feature detection seems too much like looking for plugins, to me,
anyways. If someone said "Feature detection", I'd think of Flash and
applets, not DOM.
Could be my bad, though. My brain breaks now and then.


I suppose everyone reads into it a different way. The main thing would be
to make clear what the objective is: to test for functionality before
using it. As long as that message gets across, the method of delivery is
less important.

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #7
On Fri, 01 Oct 2004 19:02:04 GMT, Michael Winter wrote:
On Fri, 1 Oct 2004 13:35:51 -0500, kaeli <ti******@NOSPA M.comcast.net>
Feature detection seems too much like looking for plugins, to me,
anyways. If someone said "Feature detection", I'd think of Flash and
applets, not DOM.


I suppose I would refer to that as 'plug-in detection' (shrugs)

Note that you will get a lot more hits on the group for
'object detection' than 'feature detection', but I think
it is important not to eschew browser sniffing for OD, only
to miss the finer point and slip into using OI (inference).
I suppose everyone reads into it a different way.


Having 'standardised' (or at least commonly understood) terms
for describing the subtle differences would be very handy, and
it seems this forum is an ideal places to promote such terms.

--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.lensescapes.com/ Images that escape the mundane
Jul 23 '05 #8
In article <opse7gi5vjx13k vk@atlantis>, M.******@blueyo nder.co.invalid
enlightened us with...

Can one of you lovely gentlemen explain the difference please?


We're not being too pedantic, are we? :P


Who, me?
*heh*
I know what *I* meant, but I'm not sure what you all mean. *smiles*


We all mean the same thing. :)

The debate here is that the phrase, object detection, seems too much like,
object inference. The latter being a form of browser detection which uses
one or more objects that the author thinks is unique to a browser (and
usually isn't).


Ah, okay.
I know what you mean, but have never heard that term for it. I just
considered it a really bad way of doing browser detection. Actually, it's the
way I see it most, aside from the navigator object. And it usually fails
utterly in older versions of Opera, notably. *laughs*
Is this object or feature detection:


I'd call it feature detection because you're not just looking at objects.
I also think it gives the clear indication that you're looking at the user
agent's capabilities.
if (document.getEl ementById)
{
e = document.getEle mentById("myDiv ");
if (e.style.visibi lity)


I assume that this was a quick example,


It was. A really, really quick example. I'd normally test for style, too.
But the tip about the empty string was interesting. I didn't think about that
one. Actually, I don't use the style object at all for my stuff, but couldn't
think of a quicker example to type at the time. *grins*

I still like the term 'object detection' better. Probably because I'm weird.

--
--
~kaeli~
Do not taunt Happy Fun Ball!
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #9
On Fri, 1 Oct 2004 15:25:22 -0500, kaeli wrote:
In article <opse7gi5vjx13k vk@atlantis>, M.******@blueyo nder.co.invalid
enlightened us with...

Can one of you lovely gentlemen explain the difference please?
We're not being too pedantic, are we? :P


Who, me?
*heh*


I think he was actually referring to me, but you can take
the fall for it if you like. ..I'm easy. :-)

<snip> I still like the term 'object detection' better. Probably because I'm weird.


Stick with it. Better weird, than boring. ;-)

--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.lensescapes.com/ Images that escape the mundane
Jul 23 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
2300
by: Paul Gorodyansky | last post by:
Hi, Could not find the answer neither in FAQs not on the Web... On many javaScript 'tips' sites they say that do warn the user regarding missing .JS file one should do the following: <html> <head> .... <script src="ABC.js" ...>
102
5670
by: Skybuck Flying | last post by:
Sometime ago on the comp.lang.c, I saw a teacher's post asking why C compilers produce so many error messages as soon as a closing bracket is missing. The response was simply because the compiler can't tell where a bracket is missing.... a few weeks have past, I requested a feature for the delphi ide/editor "automatic identation of code in begin/end statements etc" and today when I woke up I suddenly released a very simple solution for this...
4
1466
by: terry | last post by:
I know that PSQL has the cool feature of doing: Adding missing FROM-clause But I want to disable it, because its silent adding can allow a bad SQL statement to execute a cartesian select (when in fact it should error out). I searched and found references to changing the postgresql.conf with: add_missing_from = false enable_implicited_join = false But neither one of these seems to disable the functionality (I did a reload after making...
4
2779
by: Paul Bromley | last post by:
Hope someone can help me here. I thought this may be easy to find on Google, but I have not come across the answer. I have developed an application in VB.Net 2003 with a manifest file for displaying with XP themes. On most sites it is running fine. On one site, some of the PCs have the application on with no problems, but on a couple I have the complaint that text is not showing on Radiobuttons that are inside Groupboxes. Additionally, on...
9
9536
by: Serguei.Goumeniouk | last post by:
Dear Experts, I have a very simple javascript codes with a following lines inside: ............................ var str = ""; .. . . . . . . . . . str = String(new Date()); // #1 str += fobj.elements.name + "=" + fobj.elements.value + "&"; // #2 str += fobj.elements.name + "=" + encodeURIComponent(fobj.elements.value) + "&"; // #3
0
1336
by: amiben | last post by:
Hi everyone. I have this problem that I am experiencing when I move a certain site from one hosting to another hosting location. This is why I think this problem is not related to ASP code, rather than to IIS settings which are different in one hosting company to another. I am talking about a site I have that has no pages on it, rather it catches 404 http errors and according to the filename of the missing page, it returns content to...
0
3275
by: glubber | last post by:
I have a cronned perl script that runs on a different server. when I try to restore it to the server below things dont copy across correctly. the target server is described below. debian 4.0 - Linux testbox.jumboentertainment.com.au 2.6.18-4-686 #1 SMP Mon Mar 26 17:17:36 UTC 2007 i686 GNU/Linux with the latest apt-get installation of postgres
7
2145
by: Michele Simionato | last post by:
I have noticed that the python-mode for Emacs that comes with the latest Ubuntu is missing the class browser. Moreover if works differently from the python-mode I was used to (for instance CTRL-c-c works as CTRL-c-! whereas CTRL-c-! is missing, etc). How can I go back to the old python-mode or at least how do I get back the class browser? Michele Simionato
0
30226
AmberJain
by: AmberJain | last post by:
Windows Autorun FAQs: List of autostart locations Linked from the Original article- "Windows Autorun FAQs: Description". Que: Can you list all the autostart locations for windows? Ans: Here is a comprehensive list of all autostart locations for Windows OSes: NOTE : These are some abbreviations used in this list. Please note them carefully: HKCU = HKEY_CURRENT_USER HKLM = HKEY_LOCAL_MACHINE
0
8666
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8597
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9145
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9010
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8880
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8853
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7703
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4356
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3033
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.