Page 1 of 1

Browser information and Screen resolution

Posted: Thu Oct 09, 2003 7:40 am
by szms
I like to check which browser and what screen resolution user is using in his/her computer when the first time he/she browse the web site. How to do that?

Can I set his/her screen resolution according to my required resolution of the web site.

Posted: Thu Oct 09, 2003 8:16 am
by scorphus
Try this:

Code: Select all

alert("Screen setup: " + screen.width + " x " + screen.height + ", " + screen.colorDepth + " bits per pixel\n" + "Browser: " + navigator.userAgent + " (" + navigator.appName + ")");
szms wrote:Can I set his/her screen resolution according to my required resolution of the web site.
I don't think it is possible.

Regards,
Scorphus.

Posted: Thu Oct 09, 2003 4:42 pm
by Paddy
szms wrote:Can I set his/her screen resolution according to my required resolution of the web site.
And if you could that would drive me nuts and I would never visit your site again.

Posted: Thu Oct 09, 2003 4:59 pm
by cybaf
It is forbidden to do that in javascript, and as Paddy wrote you would not be very popular and I think that you should "rethink" your solution. However, if you really really want to change a user's resolution you could do it with a signed javascript. There is a tool called javascript signing tool that could be used. The user will then get an alert and a question to authorize your script.

search google for "javascript signing" and you should get some more help there.

but REMEMBER... changing the users resolution is NOT the way to go to solve the problem with a site looking different in different resolutions.

//cybaf

Re: Browser information and Screen resolution

Posted: Thu Oct 09, 2003 7:19 pm
by McGruff
szms wrote:Can I set his/her screen resolution according to my required resolution of the web site.
That would be a completely unaccepable intrusion into the end user's environment.

Re: Browser information and Screen resolution

Posted: Fri Oct 10, 2003 4:31 am
by twigletmac
McGruff wrote:
szms wrote:Can I set his/her screen resolution according to my required resolution of the web site.
That would be a completely unaccepable intrusion into the end user's environment.
Just want to add to this too - no, no, no, no, no.

Design your pages so that they fit into the user's environment (choice of browser, resolution etc) don't try and fit the user to yours. If you want everybody to see your pages the exact same way you do, do screenshots, print them and post them to those who want to see them.

Mac