Contact Us Forum Rules Search Archive
WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-14-2004, 08:19 PM
WebProWorld 1,000+ Club
WebProWorld Moderator
 

Join Date: May 2004
Location: Austin, TX
Posts: 1,331
jestep RepRank 0
Default Javascript sizing

Im looking for a code that will automatically detect the size & resolution of a users browser. I think I have to use javascript, because I also want to integrate it with PHP to include an additional file if the window size is 'X' large. Any suggestions?
Reply With Quote
  #2 (permalink)  
Old 05-14-2004, 08:45 PM
calypso_webmaster's Avatar
WebProWorld Pro
 

Join Date: May 2004
Location: New Brunswick, Canada
Posts: 128
calypso_webmaster RepRank 0
Default Re: Javascript sizing

Quote:
Originally Posted by jestep
Im looking for a code that will automatically detect the size & resolution of a users browser. I think I have to use javascript, because I also want to integrate it with PHP to include an additional file if the window size is 'X' large. Any suggestions?
Here you go Jestep this should help you out..


<?
if(isset($HTTP_COOKIE_VARS["users_resolution"]))
$screen_resolution = $HTTP_COOKIE_VARS["users_resolution"];
else
{
?>
<script language="javascript">
<!--
writeCookie();

function writeCookie()
{
var today = new Date();
var the_date = new Date("May 14, 2004");
var the_cookie_date = the_date.toGMTString();
var the_cookie = "users_resolution="+ screen.width +"x"+ screen.height;
var the_cookie = the_cookie + ";expires=" + the_cookie_date;
document.cookie=the_cookie

}
//-->
</script>

I had some help with this script awhile back I got it from PHPBuddy.com I believe....hope it helps..
__________________
Micheal Geldart
CalypsoWebDesign.com
www.calypsowebdesign.com
Three Months Free Hosting! Find Out How?
Feel Free To Review:CalypsoWebDesign.com
Reply With Quote
  #3 (permalink)  
Old 05-17-2004, 11:12 AM
WebProWorld 1,000+ Club
WebProWorld Moderator
 

Join Date: May 2004
Location: Austin, TX
Posts: 1,331
jestep RepRank 0
Default

It looks like it is what Im looking for.

Thanks
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Tags: ,



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Search Engine Optimization by vBSEO 3.2.0