javascript:find screen resolution when having multiple monitors -


I am using a piece of code to determine client screen resolution, and then log it to

  & lt; Input type = "hidden" id = "DFF63C7E-FB32-49AE-8ADA-3AB5C4834FB0" name = "DFF63C7E-FB32-49AE-8ADA-3AB5C4834FB0" /> & Lt; Input type = "hidden" id = "565C07CF-0D37-41DE-B47D-A247E9BD231B" name = "565C07CF-0D37-41DE-B47D-A247E9BD231B" /> & Lt; Script type = "text / javascript" language = "javascript" & gt; Document.getElementById ("DFF63C7E-FB32-49AE-8ADA-3AB5C4834FB0"). Value = screen.width; Document.getElementById ("565C07CF-0D37-41DE-B47D-A247E 9BD231B"). Value = screen.height; & Lt; / Script & gt;  

This worked fine when testing in my localhost, but from the output log I came to know that the screen resolution was always 480x640. Does anyone know why this happens?

And I dig some more and found that I can change the resolution of my primary monitor and whether or not I open my browser in primary / secondary monitor, it always gives me the resolution of the primary monitor.

Is there a way to get the screen resolution on which the monitor browser is opened?

And obviously the next question is, if the resolution is between the changes (called from the control panel) or to move the browser to each other, to find out / update it with JS is?

  1. Could it be that your production PC actually has 640 * 480 screen resolution Is there any reason to doubt it?
  2. There is no point in getting out of its virtual machine to take a look at the real host of Javascript, so you should implement your update mechanism in the same way as you know the screen resolution address You can apply, whatever.

Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -