Question on checking for browser compatability

Jaiem's picture

They have: 1,191 posts

Joined: Apr 1999

For mouseovers and other dynamic graphics I've noticed some web sites check for the version of the browser the visitor is using while others simple say "If document.image ......"

What is the difference? Which method is better?

Thanks.

------------------
ArtsNFlies.com
Original art, hand tied flies, unique books and gifts, free sweepstakes and MORE!

John Pollock's picture

He has: 628 posts

Joined: Mar 1999

One checks for individual browsers, the other checks for the existance of the object (like document.images). Generally, the object detection is better because it offers support to third party browsers which can handle the script, rather than leaving them out. Also, it tends to shorten the code.

Jaiem's picture

They have: 1,191 posts

Joined: Apr 1999

Thanks!

------------------
ArtsNFlies.com
Original art, hand tied flies, unique books and gifts, free sweepstakes and MORE!

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.