Is it possible for jQuery define version of browser, for example IE 7.0?

View: New views
6 Messages — Rating Filter:   Alert me  

Is it possible for jQuery define version of browser, for example IE 7.0?

by mtest :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I know that jQuery can define browser:
$.browser.msie
$.browser.safari
$.browser.opera
$.browser.mozilla
but can I define version???
IE 7.0 - ?
IE 6.0 - ?
IE 5.0 - ?

Re: Is it possible for jQuery define version of browser, for example IE 7.0?

by mtest :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


also know that mozilla's version can get by $.browser.version

Re: Is it possible for jQuery define version of browser, for example IE 7.0?

by Gordon-35 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


$.browser.version

On Jun 16, 7:38 am, mtest <projects.supp...@...> wrote:
> I know that jQuery can define browser:
> $.browser.msie
> $.browser.safari
> $.browser.opera
> $.browser.mozilla
> but can I define version???
> IE 7.0 - ?
> IE 6.0 - ?
> IE 5.0 - ?

Re: Is it possible for jQuery define version of browser, for example IE 7.0?

by Roncioso :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I noticed Firefox 3rc3 with $.browser.version returns 1.9 (Gecko
version?)

On Jun 16, 8:38 am, mtest <projects.supp...@...> wrote:
> I know that jQuery can define browser:
> $.browser.msie
> $.browser.safari
> $.browser.opera
> $.browser.mozilla
> but can I define version???
> IE 7.0 - ?
> IE 6.0 - ?
> IE 5.0 - ?

Re: Is it possible for jQuery define version of browser, for example IE 7.0?

by RobG-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Jun 16, 4:38 pm, mtest <projects.supp...@...> wrote:
> I know that jQuery can define browser:
> $.browser.msie
> $.browser.safari
> $.browser.opera
> $.browser.mozilla
> but can I define version???
> IE 7.0 - ?
> IE 6.0 - ?
> IE 5.0 - ?

Browser detection is almost always based on the user agent string.  It
is known that UAs do not honestly report the vendor, version or
platform so any strategy based on that is flawed.  There are thousands
(literally) of UA strings, yet they are not guaranteed to be unique
for any particular browser or version.

Do a search for user agent string databases, there are quite a few of
them.


--
Rob

Re: Is it possible for jQuery define version of browser, for example IE 7.0?

by Isaak Malik-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Checking the version is more reliable by using object checking than the useragent string checking, or you can use both to increase the reliabilty.

IE 7:

if ( document.all && !window.opera && window.XMLHttpRequest && $.browser.msie ) var isIE7 = true;

or in HTML which is much better:

<!––[if IE 7]>
<script type="text/javascript">var isIE7 = true;</script>
<![endif]––>

IE6:

if ( document.all && !window.opera && !window.XMLHttpRequest && $.browser.msie ) var isIE6 = true;

or

<!––[if IE 6]>
<script type="text/javascript">var isIE6 = true;</script>
<![endif]––>

It is ok to leave out the "$.browser.msie".

I hope this willbe of any use.

On 6/16/08, RobG <rgqld@...> wrote:

On Jun 16, 4:38 pm, mtest <projects.supp...@...> wrote:
> I know that jQuery can define browser:
> $.browser.msie
> $.browser.safari
> $.browser.opera
> $.browser.mozilla
> but can I define version???
> IE 7.0 - ?
> IE 6.0 - ?
> IE 5.0 - ?


Browser detection is almost always based on the user agent string.  It
is known that UAs do not honestly report the vendor, version or
platform so any strategy based on that is flawed.  There are thousands
(literally) of UA strings, yet they are not guaranteed to be unique
for any particular browser or version.

Do a search for user agent string databases, there are quite a few of
them.



--
Rob



--
Isaak Malik
Web Developer