Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Why does JQuery think my IE7 is IE6?
Old 03-21-2010, 03:38 AM Why does JQuery think my IE7 is IE6?
TWD
TWD's Avatar
King Spam Talker

Posts: 1,190
Trades: 0
I am running this browser sniffing script in compatibility mode
thats why the $j instead of just $

// Is this a version of IE?
if($j.browser.msie){
$j('body').addClass('browserIE');

// Add the version number
$j('body').addClass('browserIE' + $j.browser.version.substring(0,1));
var usingBrowser = $j.browser.version.substring(0,1);
alert("IE "+usingBrowser);

}

It works fine and gives me the correct answer in IE6 and IE8 but
in IE7 the alert tells me "IE 6"

Whats up with that?

Thats problem number one.

Problem two is the while the alert message works fine, it
doesnt seem to want to add the new classes.

Last edited by TWD; 03-21-2010 at 07:58 AM..
TWD is online now
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-21-2010, 11:22 AM Re: Why does JQuery think my IE7 is IE6?
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,987
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
No idea. Maybe there's a bug, but $.browser has been deprecated so they might not be fixing it. Why don't you try a different approach, like using conditional comments to activate different scripts? That will work every time.
__________________
I build web things. I work for the startup
Please login or register to view this content. Registration is FREE
.
wayfarer07 is offline
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Reply     « Reply to Why does JQuery think my IE7 is IE6?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.09613 seconds with 12 queries