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.
Browser information and Screen resolution
Moderator: General Moderators
- scorphus
- Forum Regular
- Posts: 589
- Joined: Fri May 09, 2003 11:53 pm
- Location: Belo Horizonte, Brazil
- Contact:
Try this:
Regards,
Scorphus.
Code: Select all
alert("Screen setup: " + screen.width + " x " + screen.height + ", " + screen.colorDepth + " bits per pixel\n" + "Browser: " + navigator.userAgent + " (" + navigator.appName + ")");I don't think it is possible.szms wrote:Can I set his/her screen resolution according to my required resolution of the web site.
Regards,
Scorphus.
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
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
That would be a completely unaccepable intrusion into the end user's environment.szms wrote:Can I set his/her screen resolution according to my required resolution of the web site.
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
Re: Browser information and Screen resolution
Just want to add to this too - no, no, no, no, no.McGruff wrote:That would be a completely unaccepable intrusion into the end user's environment.szms wrote:Can I set his/her screen resolution according to my required resolution of the web site.
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