By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,142 Members | 1,839 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,142 IT Pros & Developers. It's quick & easy.

Detect and track visitors screen resolutions

P: n/a
Does anyone know the best way to detect and track a visitors screen
resolution. I know the javascript to detect the users resolution but
I am a bit confused on the best way to track and save this. Should I
save it to a database or is it easier to save it to a text file?
Jul 23 '05 #1
Share this Question
Share on Google+
8 Replies


P: n/a
Brent wrote:
Does anyone know the best way to detect and track a visitors screen
resolution.
That depends on why you want to know.
I know the javascript to detect the users resolution but I am a bit
confused on the best way to track and save this.
That, again, depends on why you want to know. Screen resolution is just
about irrelevant on the web.

Should I save it to a database or is it easier to save it to a text file?


That depends on your server setup, what languages you have access to,
and what read/write priveleges you have.
--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/
Jul 23 '05 #2

P: n/a
In article <ad*************************@posting.google.com> ,
br****@yahoo.com enlightened us with...
Does anyone know the best way to detect and track a visitors screen
resolution. I know the javascript to detect the users resolution but
I am a bit confused on the best way to track and save this. Should I
save it to a database or is it easier to save it to a text file?


Why?

Note that screen resolution doesn't necessarily mean anything.
My screen resolution is quite large so that I can multi-task. My browser
NEVER takes up the whole screen.
Then there's people who use TWO screens.
And webtv people.
And people who are visually impaired and use special browsers.
And people who use browsers that don't support script.
PDA users.
Phone users.
Etc.

Assuming there is actually some reason to make tracking the resolution
worthwhile, your best bet for saving the info depends on what server-
side scripting language you're planning on using. Javascript in the
normal, internet client-side environment has access to neither server-
side databases nor files. You'd have to detect the info with javascript,
then "call" a server-side script or CGI to save the data. There are many
ways to accomplish that.

--
--
~kaeli~
Is it possible to be totally partial?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #3

P: n/a
Randy Webb <hi************@aol.com> wrote in message news:<kZ********************@comcast.com>...
Brent wrote:
Does anyone know the best way to detect and track a visitors screen
resolution.


That depends on why you want to know.
I know the javascript to detect the users resolution but I am a bit
> confused on the best way to track and save this.


That, again, depends on why you want to know. Screen resolution is just
about irrelevant on the web.

Should I save it to a database or is it easier to save it to a text file?


That depends on your server setup, what languages you have access to,
and what read/write priveleges you have.

The reaseon I want to know is so we can decide how to develope our new
site. I have all priveleges and have access to all languages.
Jul 23 '05 #4

P: n/a
In article <ad**************************@posting.google.com >,
br****@yahoo.com enlightened us with...


The reaseon I want to know is so we can decide how to develope our new
site. I have all priveleges and have access to all languages.


Any good developer develops for ALL resolutions. Especially since
resolution is completely meaningless in many situations. See my previous
post to this question.

See comp.infosystems.www.authoring.site-design and related groups for
how to properly design a website.

--
--
~kaeli~
"No matter what happens, somebody will find a way to take
it too seriously."
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #5

P: n/a
kaeli <ti******@NOSPAM.comcast.net> wrote in message news:<MP************************@nntp.lucent.com>. ..
In article <ad**************************@posting.google.com >,
br****@yahoo.com enlightened us with...


The reaseon I want to know is so we can decide how to develope our new
site. I have all priveleges and have access to all languages.


Any good developer develops for ALL resolutions. Especially since
resolution is completely meaningless in many situations. See my previous
post to this question.

See comp.infosystems.www.authoring.site-design and related groups for
how to properly design a website.

--


Listen, I don't care about your opinion on screen resolutions. It is
none of your business why I want to track this. If you are not going
to help me with my problem then don't respond.
Jul 23 '05 #6

P: n/a
> Listen, I don't care about your opinion on screen resolutions. It is
none of your business why I want to track this. If you are not going
to help me with my problem then don't respond.


Then don't ask questions here. This forum isn't just to do your work for
you, it's also hopefully to teach you something.

Screen resolution on a public website is - listen carefully - meaningless.
A Waste Of The Programmer's Time. Writing to screen resolution is bad
programming.

As for tracking such information, there is no right way - it depends on your
skills and what your ISP will let you do. If you're on a Windows server
with an Access database and no FileScriptingObject, then save to database.
If you can use the FSO and don't want to use a database, then write a text
file. If it's a Linux/Unix box, then I've got no f'n clue what specifically
you have available, but the rules are the same.

And no whining.

- Wm
--
William Morris
Product Development, Seritas LLC
Kansas City, Missouri
Jul 23 '05 #7

P: n/a
Brent wrote:
kaeli <ti******@NOSPAM.comcast.net> wrote in message news:<MP************************@nntp.lucent.com>. ..
In article <ad**************************@posting.google.com >,
br****@yahoo.com enlightened us with...


The reaseon I want to know is so we can decide how to develope our new
site. I have all priveleges and have access to all languages.


Any good developer develops for ALL resolutions. Especially since
resolution is completely meaningless in many situations. See my previous
post to this question.

See comp.infosystems.www.authoring.site-design and related groups for
how to properly design a website.


Listen, I don't care about your opinion on screen resolutions. It is
none of your business why I want to track this. If you are not going
to help me with my problem then don't respond.


On the client:

<script type="text/javascript">
(new Image()).src = 'http://server/cgi-bin/saveres.pl?width=' + screen.width + '&height=' + screen.height;
</script>

On the server (running Perl):

#!/usr/contrib/bin/perl

open (FILE, ">>saveres.txt");
print FILE $ENV{'QUERY_STRING'} . "\n";
close (FILE);

Knock yourself out.
For someone who has to depend on the kindness of strangers to accomplish your goals in life, you seem to be
lacking the necessary social grease with which to lubricate your interactions and achieve those goals.

--
| Grant Wagner <gw*****@agricoreunited.com>

* Client-side Javascript and Netscape 4 DOM Reference available at:
* http://devedge.netscape.com/library/...ce/frames.html
* Internet Explorer DOM Reference available at:
* http://msdn.microsoft.com/workshop/a...ence_entry.asp
* Netscape 6/7 DOM Reference available at:
* http://www.mozilla.org/docs/dom/domref/
* Tips for upgrading JavaScript for Netscape 7 / Mozilla
* http://www.mozilla.org/docs/web-deve...upgrade_2.html
Jul 23 '05 #8

P: n/a
Brent wrote:
Does anyone know the best way to detect and track a visitors screen
resolution. I know the javascript to detect the users resolution
[...]

You do not because there is none that works as supposed. We had this
discussion recently and IMNSHO it answered all the questions regarding
the issue. It is not necessary to do the same discussions over and
over again, especially not every other week. Google is your friend.
[psf 6.1]
PointedEars
Jul 23 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.