Navigator.userAgent
Jul 23, 2005
navigator.userAgent returns information about the user operting system,
Browser etc.
Usually you get somthing like:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
or
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.0.3705; .NET
CLR 1.1.4322)
or
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624
Netscape/7.1 (ax)
imho there is too many information, most of it confusing for the user. What
I would like to do is, evaluate the information and
reduce it to the opereting system and browser version.
e.g.
MSIE 6.0, Windows XP
or
Netscape 7.1, Windows 98
obstacles:
- As far as I know, the structure of the data returned by
navigator.userAgent depends on the browser.
So a specification for each browser would be a good starting point, any
ideas where to find?
- Why do I get "Windows NT 5.1" instead of "Windows XP"? Any other
synonyms?
I neither tested it on macs nor linux systems...
View 12 Replies
Jan 5, 2003
Why is /MSIE (5.5)|[6789]/.test(navigator.userAgent) true
when navigator.userAgent == "Opera/7.0 (Windows 2000; U) [en]" ?
View 3 Replies
View Related
Sep 1, 2006
I'm picking apart the Yahoo! UI event.js library and stripping it down
to just what I need. I'm also trying to make the parts I use better.
I'm stumped on how to fix the code for the getPageX() method. This
method is supposed to give the same value in IE as other browsers for
the event position relative to the left of the page. This value will be
greater than the position relative to the left of the browser if the
browser is scrolled to the right. What would be the appropriate feature
detection to use for the conditional in the following line?
if ( this.isIE ) {
Thank you,
Peter
isSafari: (/Safari|Konqueror|KHTML/gi).test(navigator.userAgent),
isIE: (!this.isSafari && !navigator.userAgent.match(/opera/gi) &&
navigator.userAgent.match(/msie/gi)),
getPageX: function(ev) {
var x = ev.pageX;
if (!x && 0 !== x) {
x = ev.clientX || 0;
if ( this.isIE ) {
x += this._getScroll()[1];
}
}
return x;
},
_getScroll: function() {
var dd = document.documentElement, db = document.body;
if (dd && dd.scrollTop) {
return [dd.scrollTop, dd.scrollLeft];
} else if (db) {
return [db.scrollTop, db.scrollLeft];
}
return [0, 0];
}
View 10 Replies
View Related
Sep 27, 2010
I need to know that navigator (IE or FF) was restarted or just know that cache was deleted.When I change sth in JS script, my old script is still in user navigator cache. I need user to use my new script, so he/she must clear cache or restart navigator (or maybe sth else). I show allert() that he/she mast do it, but how can I ckeck he/she did it?
View 1 Replies
View Related
Jul 23, 2005
I am trying to read all the navigator object elements
1. Using the navigator.length returns undefined, cant use for loop;
2.Using and array of known elements like
var a = Array("appCodeName","appName","appVersion");
I seem to miss something to get it combined like navigator.a[i]
View 13 Replies
View Related
Sep 1, 2005
Where can I find a list of valid names for Navigator.AppName?
View 13 Replies
View Related
Jun 16, 2009
I have this code and I don't understand why this isn't working.Head section:
<script>
function IEorMoz(){
// get browser resolution
[code]...
ps I know the 2 div's are the same, but this is only for testing.
View 40 Replies
View Related
Jul 23, 2005
I am trying to test changes to my site (made only on my local machine so
far) in IE v6, Mozilla 1.6, and Opera 7.5.
When I test "navigator.javaEnabled in IE it corretly reports true/false
depending on whether javascript is enabled.
However, both Mozilla and Opera *always* return false. How can I properly
test to see if javascript is enabled/disabled in these two browsers? (If you
have a reference on the web, please point me to it as I've spent several
hours trying to find what I need.) Code:
View 1 Replies
View Related
Aug 15, 2011
I dedicated some time creating my own carousel with images, and got a little problem:
It works perfectly when I´m on the website, but when I change between the tabs on firefox/chrome, it seems that the function make some kind of queue, and when I come back to the website, it execute the function a lot of times at the same times, passing between the images in less than half second (I configured to change every 5 seconds).
function circCar (car) {
Here is the code, and if anybody wants to see the problem, open this url, open another tab (blank or another website) and stay on it about 15 seconds, when you come back to my site, you will see the queued function. [url]
View 2 Replies
View Related