Browsers

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

User avatar
The Phoenix
Forum Contributor
Posts: 294
Joined: Fri Oct 06, 2006 8:12 pm

Post by The Phoenix »

AKA Panama Jack wrote:I just mentioned it to point out that browser sniffing can be a useless thing to do anymore because you never know what browser is really browsing your site.
I like the use of "Can be" there (honest, not sarcastic).

Lets assume the OP wants to avoid adding a feature to his site that is unsupported in some browsers. (Canvas is a good example, as IE doesn't support it yet, but most other browsers do now).

If he sniffs the browser of users, he might find (assuming a technical site) that only 40% of his users use a browser other than IE. So perhaps he decides not to use canvas - despite the fact that 20% of his users are using Opera or Firefox, but disguising them as IE!

However, if instead he chose to sniff the browser's support for that technology, he would likely have close to a 100% accurate view of how many users could use canvas (in the example, 60%). That would lead to a very different result!

But the reason I like the "can be" is that there are other situations where browsing sniffing isn't entirely useless. If you want to get a (rough, inaccurate) view of the *trending* on browser usage, browser sniffing is very good.

Generally, right on the money, and the exception fits neatly in "can be". :)

Nicely worded.
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

There are ways to "sniff out" what a client's browser supports, rather than what it actually is, correct?
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post by onion2k »

The Phoenix wrote:(Canvas is a good example, as IE doesn't support it yet, but most other browsers do now).
http://www.ooer.com/autograph/canvas

Uses canvas, works in IE. Thank Google.
User avatar
The Phoenix
Forum Contributor
Posts: 294
Joined: Fri Oct 06, 2006 8:12 pm

Post by The Phoenix »

onion2k wrote:
The Phoenix wrote:(Canvas is a good example, as IE doesn't support it yet, but most other browsers do now).
http://www.ooer.com/autograph/canvas

Uses canvas, works in IE. Thank Google.
Except that its not canvas thats doing the driving in IE in that example. It uses a javascript (exc.js) that adds support for canvas based on sniffing the browser.

Which proves my point.. :)
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post by onion2k »

The Phoenix wrote:Except that its not canvas thats doing the driving in IE in that example. It uses a javascript (exc.js) that adds support for canvas based on sniffing the browser.

Which proves my point.. :)
It's VML in IE that's driving the content, but it makes very little difference to the developer (apart from it being rather slow). I was just pointing out that Canvas is 'supported' in IE.
User avatar
The Phoenix
Forum Contributor
Posts: 294
Joined: Fri Oct 06, 2006 8:12 pm

Post by The Phoenix »

onion2k wrote:It's VML in IE that's driving the content, but it makes very little difference to the developer (apart from it being rather slow). I was just pointing out that Canvas is 'supported' in IE.
But its not. IE does not support the Canvas tag. It supports VML, and you can hack a work-around that makes it similar, but that is not the same as supporting the canvas tag.

Canvas is not supported in IE yet.
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post by onion2k »

That's what the apostrophes around 'supported' meant.
Post Reply