You are here: Re: hwo to get browser window size? « PHP Programming Language « IT news, forums, messages
Re: hwo to get browser window size?

Posted by Erwin Moller on 04/04/06 13:56

webramz@gmail.com wrote:

> You can do this by JavaScript not PHP (or both of them together for
> some reason):
>
> <script language="JavaScript>

A little addition:

<script type="text/javascript">
is better than
<script language="Javascript">

The ancient language-tag is depricated for some time and could be dropped by
browsers anytime. (better safe than sorry. :-)


> var w = screen.width;
> var h = screen.height;

In case you care about colordepth, screen also holds a colorDepth.
var colorDepth = screen.colorDepth;

8 means 256 colors.
So it contains the base-2 logarithm.

Regards,
Erwin Moller

>
> alert('You are using ' + w + 'x' + h + ' resolution...!');
>
> </script>
>
> Behzad Nategh

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация