perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hall, Philippe" <>
Subject RE: Screen Resolution Detection
Date Tue, 15 Jun 2004 20:11:04 GMT
	As far as I know you can't do this directly -- javascript is, of course, executed after the
page is rendered, which is WAY after the epl has been executed and served.  
	I do have an idea of how you could do it indirectly, though -- on the first page of your
site that someone visits, you could acquire their resolution and save it for use on subsequent
pages by writing an external script call that includes the resolution, ie:

	document.write('<script src="/js/screen_res.epl?res='+screen.width+'x'+screen.height+'">');

and then on screen_res.epl you could save it with %udat
	$udat{'resolution'} = $fdat{'res'};

And then you'd have it captured for the users entire session while keeping it relatively transparent
to the user.

Perhaps others will have a niftier solution though -- I am but a lowly web programmer.

Philippe Hall

-----Original Message-----
From: Derrick Spell []
Sent: Tuesday, June 15, 2004 3:52 PM
Subject: Screen Resolution Detection

Is there a way in perl to detect a users screen resolution?  I want to 
execute one of two epl files based on the screen resolution.  I know I 
can do this with Javascript, but I don't think there is anyway to get 
the variable from the javascript to the emperl script.

Derrick Spell
Webmaster / Programmer

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message