473,385 Members | 1,317 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

extracting browser information

Rex
I want to find out as much as I can using JavaScript
about the user's browser and possible about the user himself or
herself.
is there a good guide anywhere on the Internet that explains what
information can be extracted using JavaScript? on various web pages I
see short mentions of variables such as document.referrer and
browser.name as I have yet to find a comprehensive listing of these
variables.

Can someone please point me to a listing of all such variables?

Thanks.

Jul 13 '06 #1
4 1832
Rex said the following on 7/13/2006 11:45 AM:
I want to find out as much as I can using JavaScript
about the user's browser and possible about the user himself or
herself.
Interesting.

navigator.sex --gives the sex of the user.
navigator.lastSex --gives the date they last had sex.
navigator.favoriteDrink --gives the users favorite drink.
navigator.stupid --gives the feasibility of this exercise.
is there a good guide anywhere on the Internet that explains what
information can be extracted using JavaScript?
A better question would be "What do you want to know?"
on various web pages I see short mentions of variables such as
document.referrer
document.referrer gives you the address - in limited circumstances - of
the page that opened the current page.
and browser.name as I have yet to find a comprehensive listing of these variables.
Never seen "browser.name"
Can someone please point me to a listing of all such variables?
<URL: http://groups.google.com/group/comp.lang.javascript>

Happy hunting.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Temporarily at: http://members.aol.com/_ht_a/hikksnotathome/cljfaq/
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jul 13 '06 #2
Unlike the last poster, I'll try to give you some info. Please check
out these references and look at the objects and their properties

http://msdn.microsoft.com/library/de...ce/objects.asp
http://developer.mozilla.org/en/docs..._DOM_Reference

In particular would be the properties of window.navigator (also called
window.clientInformation in IE). Just be sure not to try to access
non-properties of objects. For example, mozilla browsers don't have the
window.clientInformation so use something like the following.
var clientInformation = {};
if( window.clientInformation )
{
if( window.clientInformation.cpuClass )
clientInformation[ 'cpuClass' ] =
window.clientInformation.cpuClass;
}
This will avoid exceptions when trying to query the properties

Rex wrote:
I want to find out as much as I can using JavaScript
about the user's browser and possible about the user himself or
herself.
is there a good guide anywhere on the Internet that explains what
information can be extracted using JavaScript? on various web pages I
see short mentions of variables such as document.referrer and
browser.name as I have yet to find a comprehensive listing of these
variables.

Can someone please point me to a listing of all such variables?

Thanks.
Jul 13 '06 #3
Rex

bobzimuta wrote:
Unlike the last poster, I'll try to give you some info. Please check
out these references and look at the objects and their properties
Thank you kindly.

Jul 13 '06 #4
bobzimuta said the following on 7/13/2006 12:04 PM:
Unlike the last poster,
What "last poster"? You mean the one who quoted properly and didn't turn
the post upside down?
I'll try to give you some info.
And the "last poster" didn't? I did, it just wasn't what you thought you
would see is all.
Please check out these references and look at the objects and their properties

http://msdn.microsoft.com/library/de...ce/objects.asp
http://developer.mozilla.org/en/docs..._DOM_Reference

In particular would be the properties of window.navigator (also called
window.clientInformation in IE).
All of which is unreliable and easily spoofed which makes it useless to
anybody that knows anything about them.
Just be sure not to try to access non-properties of objects.
Feature detection and then you don't *care* what browser it is.
For example, mozilla browsers don't have the
window.clientInformation so use something like the following.
var clientInformation = {};
if( window.clientInformation )
That test, with the code, doesn't do what you think it does.

alert(window.clientInformation) //---[object Object]

Without the var clientInformation, it alerts [object Navigator]

If you want the navigator object, just refer to it directly:

window.navigator
{
if( window.clientInformation.cpuClass )
clientInformation[ 'cpuClass' ] =
window.clientInformation.cpuClass;
}
This will avoid exceptions when trying to query the properties
It is called "feature detection" and when you properly feature detect,
the browser becomes irrelevant. Even when the UA is not a browser at all.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Temporarily at: http://members.aol.com/_ht_a/hikksnotathome/cljfaq/
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jul 13 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Hayden Kirk | last post by:
Does anyone know where I should start with this. Im trying to extract the information in: $_SERVER['HTTP_USER_AGENT' But I dont know how to get the information out? What functions should I be...
0
by: Gnaneshwar Babu | last post by:
Hi I am facing a problem with extracting event logs of win32 to a file. Am using the following code to extract eventlogs to file use Win32::EventLog; $handle=Win32::EventLog->new("System",...
5
by: Astra | last post by:
Hi All Is there an ASP way of extracting the height and width of a swf file so that I can specify these dims when adding the whole OBJECT code to the web page? Thanks Robbie
1
by: v0lcan0 | last post by:
Any help on extracting the time part from the datetime field in SQL database. even though i had entered only the time part in the database when i extract the field it gives me only the date...
2
by: Chris Belcher | last post by:
First some background... The database tracks Action Items assigned to a group of 20 or so managers. Once the assignment is created it is then emailed to each of the managers that are included in...
1
by: detho | last post by:
Hi everyone... I am currently developing a streaming movie front-end for my companies' intranet. The script is done with PHP on the back-end and HTML and CSS for the front-end. Basically, the...
4
by: Damo | last post by:
I have a program, That retrieves a webpage , such as a search engine results page from the web, Then I need to go through the document and retrieve just the search results. The problem is I want to...
1
by: TWX | last post by:
Hi there. I need to create a PHP programme that will return a person's birthday when his class and index number is keyed. I have the neccesary information but I only know how to create the frame of...
0
by: koneo | last post by:
I had previously created an app that used an IE browser control to load our company "case managment" web app. The application would pull information from the loaded case and would use this...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.