Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #29466 > unrolled thread

determining screen resolution over the web

Started byRoedy Green <see_website@mindprod.com.invalid>
First post2014-07-31 15:33 -0700
Last post2014-08-04 15:20 +0300
Articles 10 — 7 participants

Back to article view | Back to comp.lang.java.programmer


Contents

  determining screen resolution over the web Roedy Green <see_website@mindprod.com.invalid> - 2014-07-31 15:33 -0700
    Re: determining screen resolution over the web Knute Johnson <eternal@knutejohnson.com> - 2014-07-31 16:02 -0700
      Re: determining screen resolution over the web Roedy Green <see_website@mindprod.com.invalid> - 2014-07-31 16:15 -0700
        Re: determining screen resolution over the web Knute Johnson <eternal@knutejohnson.com> - 2014-07-31 16:40 -0700
          Re: determining screen resolution over the web Joshua Cranmer 🐧 <Pidgeot18@verizon.invalid> - 2014-08-01 09:41 -0500
            Re: determining screen resolution over the web Knute Johnson <eternal@knutejohnson.com> - 2014-08-01 08:12 -0700
          Re: determining screen resolution over the web Gene Wirchenko <genew@telus.net> - 2014-08-01 11:01 -0700
          Re: determining screen resolution over the web Eric Sosman <esosman@comcast-dot-net.invalid> - 2014-08-01 16:07 -0400
    Re: determining screen resolution over the web Arne Vajhøj <arne@vajhoej.dk> - 2014-07-31 22:22 -0400
    Re: determining screen resolution over the web Jukka Lahtinen <jtfjdehf@hotmail.com.invalid> - 2014-08-04 15:20 +0300

#29466 — determining screen resolution over the web

FromRoedy Green <see_website@mindprod.com.invalid>
Date2014-07-31 15:33 -0700
Subjectdetermining screen resolution over the web
Message-ID<btglt914p7l0d1ertsa8d5326hji5g90vv@4ax.com>
If somebody sends you an HTTP request, how do you find out his screen
resolution to send back an reasonably sized HTML response?

<link href="../mindprodsmall.css" type="text/css" rel="stylesheet"
media="handheld">
<link href="../mindprodbig.css" type="text/css" rel="stylesheet"
media="screen">

lets the same content be viewed different ways, but it would seem you
also want to prune the content for small screens.
-- 
Roedy Green Canadian Mind Products http://mindprod.com
The art of strongly-typed language design is largely arranging 
that errors are automatically detected as soon as possible
in the compose, compile, run cycle.

[toc] | [next] | [standalone]


#29467

FromKnute Johnson <eternal@knutejohnson.com>
Date2014-07-31 16:02 -0700
Message-ID<lrehts$u15$1@dont-email.me>
In reply to#29466
On 7/31/2014 15:33, Roedy Green wrote:
> If somebody sends you an HTTP request, how do you find out his screen
> resolution to send back an reasonably sized HTML response?
>
> <link href="../mindprodsmall.css" type="text/css" rel="stylesheet"
> media="handheld">
> <link href="../mindprodbig.css" type="text/css" rel="stylesheet"
> media="screen">
>
> lets the same content be viewed different ways, but it would seem you
> also want to prune the content for small screens.
>

Do all your CSS in percentages rather than pixels or ems.

-- 

Knute Johnson

[toc] | [prev] | [next] | [standalone]


#29468

FromRoedy Green <see_website@mindprod.com.invalid>
Date2014-07-31 16:15 -0700
Message-ID<7fjlt9d0e20gdsn3feh9vlu5jq9035qofu@4ax.com>
In reply to#29467
On Thu, 31 Jul 2014 16:02:24 -0700, Knute Johnson
<eternal@knutejohnson.com> wrote, quoted or indirectly quoted someone
who said :

>Do all your CSS in percentages rather than pixels or ems.

Still to do it properly you have to send different content, not just
format it differently.

You need smaller chunks with more requests for more.

I am writing an essay on the problem at
http://mindprod.com/jgloss/multiscreen.html
-- 
Roedy Green Canadian Mind Products http://mindprod.com
The art of strongly-typed language design is largely arranging 
that errors are automatically detected as soon as possible
in the compose, compile, run cycle.

[toc] | [prev] | [next] | [standalone]


#29469

FromKnute Johnson <eternal@knutejohnson.com>
Date2014-07-31 16:40 -0700
Message-ID<lrek5g$atg$1@dont-email.me>
In reply to#29468
On 7/31/2014 16:15, Roedy Green wrote:
> On Thu, 31 Jul 2014 16:02:24 -0700, Knute Johnson
> <eternal@knutejohnson.com> wrote, quoted or indirectly quoted someone
> who said :
>
>> Do all your CSS in percentages rather than pixels or ems.
>
> Still to do it properly you have to send different content, not just
> format it differently.
>
> You need smaller chunks with more requests for more.
>
> I am writing an essay on the problem at
> http://mindprod.com/jgloss/multiscreen.html
>

I thought you were asking how to size things for a device that could 
have significantly different screen resolutions.  If you want to 
determine the browser you can use the HTTP_USER_AGENT environment 
variable and select your response accordingly.  Or as you showed above 
you can let the browser decide which type of device and restrict the 
HTML that is sent back that way.

In CSS:

@media print {
     .noprint {
         display: none;
     }
}

and then set the stuff you don't want printed with the class "noprint".

-- 

Knute Johnson

[toc] | [prev] | [next] | [standalone]


#29487

FromJoshua Cranmer 🐧 <Pidgeot18@verizon.invalid>
Date2014-08-01 09:41 -0500
Message-ID<lrg90f$qh8$1@dont-email.me>
In reply to#29469
On 7/31/2014 6:40 PM, Knute Johnson wrote:
> I thought you were asking how to size things for a device that could
> have significantly different screen resolutions.  If you want to
> determine the browser you can use the HTTP_USER_AGENT environment
> variable and select your response accordingly.

The penalty for suggesting using the User-Agent information to send data 
is execution by being electroplated.

More seriously, though, just don't do it.

-- 
Beware of bugs in the above code; I have only proved it correct, not 
tried it. -- Donald E. Knuth

[toc] | [prev] | [next] | [standalone]


#29489

FromKnute Johnson <eternal@knutejohnson.com>
Date2014-08-01 08:12 -0700
Message-ID<lrgaou$9gj$1@dont-email.me>
In reply to#29487
On 8/1/2014 07:41, Joshua Cranmer 🐧 wrote:
> On 7/31/2014 6:40 PM, Knute Johnson wrote:
>> I thought you were asking how to size things for a device that could
>> have significantly different screen resolutions.  If you want to
>> determine the browser you can use the HTTP_USER_AGENT environment
>> variable and select your response accordingly.
>
> The penalty for suggesting using the User-Agent information to send data
> is execution by being electroplated.
>
> More seriously, though, just don't do it.
>

It is easily faked if that's what you're saying.  But I do like the CSS 
options better.

-- 

Knute Johnson

[toc] | [prev] | [next] | [standalone]


#29494

FromGene Wirchenko <genew@telus.net>
Date2014-08-01 11:01 -0700
Message-ID<a4lnt99kj45ibs16luo41853l4usirhkrq@4ax.com>
In reply to#29469
On 1 Aug 2014 00:15:20 GMT, ram@zedat.fu-berlin.de (Stefan Ram) wrote:

[snip]

>  I have devised a new rule for easy pronunciation: Use the
>  first and last letter with an »i« in between: So »CSS«
>  can be pronounced »cis«, »PDF« »pif«, »HTML« »hil«, »XHMTL«
>  »xil«, »XML« »egg smell« (this is a special-case rule in
>  my pronunciation system that I had not mentioned before
>  for the sake of simplification). »Java« is usually not
>  pronounced »jia«, because »Java« already can be pronounced
>  easily as it is, so the rule does not apply.

     That could be confusing.  In particular, "CSS" could get confused
with "sys" (common short form for "system"), and PDF files could get
confused with .PIF files.

Sincerely,

Gene Wirchenko

[toc] | [prev] | [next] | [standalone]


#29495

FromEric Sosman <esosman@comcast-dot-net.invalid>
Date2014-08-01 16:07 -0400
Message-ID<lrgs2o$auv$1@dont-email.me>
In reply to#29469
On 7/31/2014 8:15 PM, Stefan Ram wrote:
> [...]
>    I have devised a new rule for easy pronunciation: Use the
>    first and last letter with an »i« in between: So »CSS«
>    can be pronounced »cis«, »PDF« »pif«, »HTML« »hil«, »XHMTL«
>    »xil«, »XML« »egg smell« (this is a special-case rule in
>    my pronunciation system that I had not mentioned before
>    for the sake of simplification). »Java« is usually not
>    pronounced »jia«, because »Java« already can be pronounced
>    easily as it is, so the rule does not apply.

     Are your complete rules posted anywhere on the wiw?

-- 
esosman@comcast-dot-net.invalid

[toc] | [prev] | [next] | [standalone]


#29473

FromArne Vajhøj <arne@vajhoej.dk>
Date2014-07-31 22:22 -0400
Message-ID<53daf9e1$0$304$14726298@news.sunsite.dk>
In reply to#29466
On 7/31/2014 6:33 PM, Roedy Green wrote:
> If somebody sends you an HTTP request, how do you find out his screen
> resolution to send back an reasonably sized HTML response?
>
> <link href="../mindprodsmall.css" type="text/css" rel="stylesheet"
> media="handheld">
> <link href="../mindprodbig.css" type="text/css" rel="stylesheet"
> media="screen">
>
> lets the same content be viewed different ways, but it would seem you
> also want to prune the content for small screens.

If all your users are on a new browser, then the most elegant solution
is to use CSS3 media queries.

Else run some JavaScript client side (in the head section) that get
the screen size and do what is needed.

Arne

[toc] | [prev] | [next] | [standalone]


#29554

FromJukka Lahtinen <jtfjdehf@hotmail.com.invalid>
Date2014-08-04 15:20 +0300
Message-ID<lv4mxs5tvm.fsf@saunalahti.fi>
In reply to#29466
Roedy Green <see_website@mindprod.com.invalid> writes:

> If somebody sends you an HTTP request, how do you find out his screen
> resolution to send back an reasonably sized HTML response?

What you want is probably NOT the screen resolution, but the size of the
browser WINDOW (or whatever application is used).
Don't assume everybody running their applications full-screen! EVER!

-- 
Jukka Lahtinen

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.programmer


csiph-web