perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hall, Philippe" <philippe.h...@augustachronicle.com>
Subject RE: Screen Resolution Detection
Date Tue, 15 Jun 2004 20:15:47 GMT
oh yeah you need a </script> in that document.write, sorry:

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


-----Original Message-----
From: Hall, Philippe 
Sent: Tuesday, June 15, 2004 4:11 PM
To: embperl@perl.apache.org
Subject: RE: Screen Resolution Detection


Hi,
	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:

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

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 [mailto:derrickspell@cdmplus.com]
Sent: Tuesday, June 15, 2004 3:52 PM
To: embperl@perl.apache.org
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: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Mime
View raw message