confused replies wrote:[color=blue]
> Thank you all for your thoughtful and timely responses to my queries;[/color]
I am[color=blue]
> considering the replies and visiting the links. If I may, I will
> recapitulate what I have learned up to now, and, though it is[/color]
off-topic for[color=blue]
> this thread, I would like to discuss my needs specifically and take[/color]
further[color=blue]
> advantage of your considerate attentions.
>
> If the approximately one in ten of users whose browser would
> not handle JS need to be reached, then the use of JS should
> only be used to augment a site, without making it JS dependent.[/color]
That is thinking about the situation the wrong way around. It shouldn't
be about reaching those users, in the sense of an active (or extra)
effort, more it should be a question of coming up with a reason for
excluding them (as there is very little need to do that given a suitable
initial design).
[color=blue]
> This would exclude higher JS functions --[/color]
Accommodating the users of javascript disabled/incapable browsers does
not have to impose any restrictions on what can be available to the
users of javascript capable dynamic browsers.
[color=blue]
> but this, too, could have a negative impact on market share,
> depending on the functions considered. Designers for
> commercial sites wanting to use advanced JS must consider the
> trade-off between the loss of that 10% of user market-share,
> compared to the gain in both initial and return business
> that could be expedited by those higher JS functions.[/color]
There is nothing mutually exclusive about employing javascript on web
sites and accommodating the users of javascript disabled/incapable
browsers. So if the first offers real gains (and I often wonder to what
extent that is true (where are the studies backing that assertion up?))
then all the gains can be achieved without any loss of usability for
less capable customers (so no need for a trade off at all).
[color=blue]
> For those writing a site that is not concerned with
> a 'bottom line', similar considerations would attend their
> efforts to 'get the message out' -- whatever it might be.
> However, when those advanced JS functions are not
> necessary, then JS dependency could be avoided by employing,
> in addition to the simple JS code, non-JS code as a backup
> to achieve the same or similar effects,[/color]
Again, specifically, what are these "advanced features" that cannot be
implemented in a modern dynamic browser without introducing a javascript
dependency? If you know nothing about javascript you are not exactly in
a position to judge what can be done without introducing any unnecessary
dependencies and what cannot. There may be a few things that cannot be
done without introducing a dependency but they are the exception (and
maybe best avoided as they are obviously optional), a little thought and
appropriate design and any web site can have its javascript cake and eat
it.
[color=blue]
> My own requirements are simple, and so far there are only two
> possible JS functions that I am interested in, if they exist.
> There are relatively easy redundant non-JS means by which I could,
> roughly, achieve the same results; but, those redundancies seem
> cumbersome compared to JS script that might work . I am not yet
> a JS programmer, however, and I would greatly appreciate your
> opinions.
>
> 1) First, my site is for displaying 2D graphic images,
> and it is vital that their presentation take full advantage
> of the size of a users monitor, regardless of its screen
> resolution settings.[/color]
This is extremely unlikely to be true. There may be a perception that
taking full advantage of the user’s screen resolution is vital, but it
is not. Desirable maybe but it is in no sense vital. (Making a realistic
assessment of the relative significance of criteria is extremely
valuable at the design stage in any project.)
In reality screen resolution (or, more precisely, desktop area pixel
dimensions, as that is the information that is actually available)
rarely has any bearing on a user’s browsing situation. It may be the
case that the users of small monitors will habitually use their browser
maximised (or in full screen mode) but the users of larger monitors and
multi monitor displays will rarely do so. Anyone with a monitor bigger
than 19 inches is actually unlikely to ever browse with the browser
window at full screen. I, for example, never expand my browser window
bigger than about 2/3 of my screen size. That leaves it about the same
size as a full screen window on a 17 inch monitor (maybe a bit under)
but that is absolutely adequate for web browsing.
This means that noticing my desktop dimensions and serving me with an
image perceived as suited to those dimensions is the worst decision that
can be made as it will actively prevent me from seeing the entire image
in my browser window without re-sizing the browser (which is something
that only rarely happens.
Multi-monitor set-ups can be even harder to cope with as the desktop
dimensions reported vary with the browser and OS. Sometimes you get
dimensions that represent the smallest box that can enclose all of the
monitor displays, which means that if the monitors are not all the same
size there will be areas of that rectangle that are not displayable on
any monitor. Alternatively the reported dimensions may be those of the
"primary" display, not necessarily the biggest and not necessarily the
one in which the browser window appears.
In the end, the dimensions of the browser window's viewable area tells
you more about the user’s situation than the desktop pixel dimensions.
[color=blue]
> CSS code <img style="width: percentage" src="graphic.file">
> enable those images to expand, or contract, to fit and fill
> screens, whatever their settings, without spillover and the
> need to scroll.[/color]
Web browsers are really bad at scaling images (they use extremely
primitive algorithms for the task), but if you want to do that you can.
You will actually be scaling relative to the window and not the
screen/desktop. (and the percentage dimensions may as well appear in the
CSS rather than the IMG tags).
[color=blue]
> However, that doesn't apply to text and their designated
> font-size, that I use for an image's title-bar, and in the
> home page that lists the links to the various images. ...[/color]
<snip>[color=blue]
> ... . If JS code can sniff a users screen resolution, then
> the value returned could be used to direct the users browser
> to pages constructed specifically for that particular resolution.[/color]
Avoid making multiple versions of the same static web page, it adds
considerably to the maintenance costs of any sight (even if that cost is
only your own time). A single server side script outputting variations
on a single page based on external criteria would be easier to handle
(but I am not sure whether this scaling idea is a good one anyway).
[color=blue]
> Or -- more elegantly -- the returned value could direct a
> particular setting for the body {font-size: px}in its controlling
> style-sheet -- since that "px" setting is the base value from
> which all subsequent size "em" values are calculated, and changing
> that one "px" value appropriately would alter all subsequent[/color]
font-sizes[color=blue]
> (and other "em" settings like padding,margin-top,bottom and height
> values), one could forgoe the need to actually write different
> style-sheets for differing screen resolutions. Does this sound
> like a strategy to pursue?[/color]
Apart form the fact that the desktop pixel dimensions have no bearing on
the user’s window dimensions, setting/modifying the relative or absolute
font size of the BODY element on a page that otherwise uses exclusively
inherited font-size relative units in its CSS will allow the entire
contents of the page to be scaled.
But scaling a page to "suite" the screen (or even the window dimensions)
is probably not a good idea. Part of the reason for allowing users to
adjust/set/override font size is to give them the opportunity to
compensate for personal conditions, be they poor eyesight or unusual
monitor configurations. Your desire to take control away from the user
and determine font size on your own criteria (even flexibly) may well
detract from a real need for that facility on the part of the user.
[color=blue]
> One example google returned of a JS screen-resolution sniffer is at
>
http://www.personal.psu.edu/faculty/...eensniffer.htm.
> Is it this simple? (I don't yet know what I'm looking at.)[/color]
That script reads - screen.width - , which is the wrong dimension to be
reading even for the screen. Instead - screen.availWidth - takes into
account things like taskbars (which are not necessarily at the bottom of
the screen), at leas on some browsers.
But whoever wrote that scrip was no programmer (had no grasp of logic)
and I wouldn’t recommend using it (or, by implication, anything else
from any site that presents it with the proposition that it be used, as
they are obviously not qualified to recognise when a script is
nonsense).
[color=blue]
> Of course, as a backup, if a users browser can't handle JS,
> I would direct the user to the pages I constructed for an
> average or common screen resolution, which, for me is 1024 x768.[/color]
You have completely missed the point. Don’t make special pages for
special conditions. Take your default 1024X768 page and use javascript
to turn it into whatever alternative page you perceive as suitable when
it gets to the client. If the whole thing is already fluid and all you
want to do is set the font-size on the body element then just do that.
It will work on every javascript capable dynamic web browser, and the
rest will already be looking at the default page.
[color=blue]
> 2) Second, my home page has no images, gifs, or thumbnails. ...[/color]
<snip>[color=blue]
> ... The meta http-equiv "no-cache"
> tags I found which purport to address this feature
> (see source code for
http://www.w3schools.com/default.asp) do not[/color]
work,
<snip>
.... ). Advice anyone?[color=blue]
>
> Also, I was elsewhere directed to this link --
>
http://httpd.apache.org/docs/mod/mod_expires.html -- ...[/color]
<snip>
Forget about javascript for this, it has no control over caching (and
the best that can be done with javascript is a bogus hack using the -
location - object). META tags are not going to be of much help either.
What you need to understand in this context is HTTP and the headers that
it uses to _influence_ caching:-
<URL:
http://www.mnot.net/cache_docs/ >
(that page is mostly about encouraging caching, but any mechanism for
encouraging caching will also facilitate discouraging it if applied to
that problem instead.)
Ultimately it will be the HTTP server (Apache) that will facilitate your
cache control, though the expires module alone is not the full solution.
Richard.