HTML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignHTML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 10th, 2000, 01:52 AM
anand anand is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2000
Posts: 24 anand User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I am very new to javascript.
I just couldn't figure out a way to differentiate between the two.

The navigator.appVersion gives me 4.0 for both IE4 and IE5

Please Help !!

Reply With Quote
  #2  
Old August 10th, 2000, 04:26 AM
mmonks mmonks is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Posts: 27 mmonks User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Yeah I discovered this as well and its very annoying. The way around it is to do this -

function checkBrowser(){
var version
if ((navigator.appVersion.substring(22,23) == "4") && (navigator.appName=="Microsoft Internet Explorer")){
version="IE4"; //IE4

}else{
version="Other"; //IE5
}
}

This is because the difference in version number is in the middle of the very long number string, not at the start.

Hope this helps.

Matt.

<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by anand:
I am very new to javascript.
I just couldn't figure out a way to differentiate between the two.

The navigator.appVersion gives me 4.0 for both IE4 and IE5

Please Help !!
[/quote]


Reply With Quote
  #3  
Old August 10th, 2000, 07:00 AM
firepages's Avatar
firepages firepages is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Feb 2000
Location: Perth West Australia
Posts: 741 firepages User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
//browsercheck by thomas brattli @ www.bratta.com//

function checkBrowser(){
this.ver=navigator.appVersion;
this.dom=document.getElementById?1:0;
this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
this.ie4=(document.all && !this.dom)?1:0;
this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
this.ns4=(document.layers && !this.dom)?1:0;
this.B=(this.ie5 | | this.ie4 | | this.ns4 | | this.ns5);
return this
}
B=new checkBrowser();


this detects ie5 and ns6 via the dom,
to use it you would test for
if(B.ie4) - or if(B.dom) for ie5 etc

------------------
Simon Wheeler
FirePages -DHTML/PHP/MySQL

Reply With Quote
  #4  
Old August 11th, 2000, 12:38 AM
anand anand is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2000
Posts: 24 anand User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks Guys !!!

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignHTML Programming > Differentiate between IE4 & IE5


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway