473,836 Members | 2,086 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

hwo to get browser window size?

I want to collect stats about people viewing my web site.

Actually, I already use Awstats, but it doesn't do what I want, so I
will code it myself.

I want to know what size browser window visitors to my site use
(preferably; failing that, what their monitor resolution is).

I want this info so that I can know what sort of resolution to display
my photographs at.

Any ideas?

Thanks in advance.

Apr 4 '06
10 50054

we*****@gmail.c om wrote:
You can do this by JavaScript not PHP (or both of them together for
some reason):

<script language="JavaS cript>
var w = screen.width;
var h = screen.height;

alert('You are using ' + w + 'x' + h + ' resolution...!' );


And then, you can put links to different Css files, each of them
related with a particular resolution
<a href="yoursite. php?res=1024> your resolution</a><a href
="yoursite.php? res=800 --- and so on

I'm asuming that the visual layout of your site is made through css.
I've done it once, and worked like a charm. I don't understand why some
people thik that this shouldn't be done at all ¿?

regards - jm

Apr 26 '06 #11

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

Similar topics

by: Put 030516 in email subj to get thru | last post by:
I've always been bothered about having to statically declare the size of a Java applet window (container?) in the calling HTML. I've always wanted the moral equivalent of width=50% statement (of the window or frame). I'm trying to use Javascript to do so. I can sort of get an example working in a Mozilla browser: > <!-- This works on Mozilla only (and maybe netscape) --> > <script language="Javascript"> > document.write( "<applet...
by: Stella | last post by:
Hi, I am attempting to create a site which validates as XHTML 1.1. So far I have got it fully validated but I am not happy with the way Internet Explorer displays the site when the window is small. For some reason it treats the table layout as though it is a fixed width, giving a nasty horizontal scroll bar - but if you click refresh it behaves correctly, wrapping content within the window. The site works well with Netscape, Mozilla...
by: spencer | last post by:
Hello, I have an index page with an autoscroller writen with CSS. The problem is the scrolling content(text and inages)'s position is correct but will off position when the broswer(IE) window size was changed. How can I make the scrolling content "stick" the position with respect to the scrollowing box? Your advise is appreciated. Spencer
by: Just D. | last post by:
How can we get the browser window size from C# codebehind? What's the easiest way to do that? Just D.
by: Chris | last post by:
Hello, Is there any formula / functions available for finding a client IE window size. I would like to obtain this information and dynamically move controls / elements based on the window height / width? TIA
by: =?Utf-8?B?KioqKiBLaXRlT3JlZ29uICoqKio=?= | last post by:
I am displaying some dynamic data in a content page, how do i figure out the height and width of the browser in asp.net? I know i can write javascript on the client side to get the information, but i need this information on the server side. thanks. -- Just another lost developer.....
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I modify the current browser window? ----------------------------------------------------------------------- In a default security environment you are very limited in how much you can modify the current browser window. You can use ` window.resizeTo ` or ` window.moveTo ` to resize or move a window respectively, but that is it. Normally you can...
by: gauchomatt | last post by:
I have a liquid site which expands perfectly when the browser window is larger than the actual content. However, when I decrease the browser window size to a point that it's smaller horizontally than the content, my background div's and their images start to decrease horizontally. I think it has something to do with my #main div as well as my #wrap div's. They are the ones decreasing horizontally and eliminating everything in their path...
by: Jon Gordon | last post by:
Hey all, I have a photo website with a horizontal scrolling frame. I was wondering if it's possible to have the frame change size with the browser window. I'd rather not give my website but here's an example of the style: http://www.jedroot.com/photogr/ga1/aroch-fashion.php?story=http://www.jedroot.com/photogr/ga1/fashion/french/french-0710-woosha.html I'd really love it if the frame could change width when I changed the width of my...
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.