Dom compliance

N

nitrospectide

I am a designer who is pushing hard to use standards compliant best
practices in all of my web work. Javascript is an area where I feel
pretty ignorant, and don't know how to tell what is compliant with
current best practices, and what isn't. Is there some sort of
validator like the w3c has for xhtml and css? Are there things to look
for in code that tell you if it's up to snuff or not?

For instance, i was given this delightfully concise script for
resizing a browser to full screen. I find it to be elegant, and to-the-
point (much cleaner than the code forking stuff I'd used in the past).
However, it only works in IE and Firefox. No Opera. No Netscape. Is
the fix simple and small, or do I have to go back to the complicated
scripts of the past?

Here's the code:

self.moveTo(0,0)
self.resizeTo(screen.availWidth,screen.availHeight)
 
L

Lee

nitrospectide said:
I am a designer who is pushing hard to use standards compliant best
practices in all of my web work. Javascript is an area where I feel
pretty ignorant, and don't know how to tell what is compliant with
current best practices, and what isn't. Is there some sort of
validator like the w3c has for xhtml and css? Are there things to look
for in code that tell you if it's up to snuff or not?

For instance, i was given this delightfully concise script for
resizing a browser to full screen. I find it to be elegant, and to-the-
point (much cleaner than the code forking stuff I'd used in the past).
However, it only works in IE and Firefox. No Opera. No Netscape. Is
the fix simple and small, or do I have to go back to the complicated
scripts of the past?

Here's the code:

self.moveTo(0,0)
self.resizeTo(screen.availWidth,screen.availHeight)

The first thing to consider is whether resizing a window is, itself,
compliant with current best practices. I believe that's a "no".

It's probably acceptable in some intranet applications, where you're
sure that the user's screen isn't intentionally larger than any
single window they would ever want to open, and where you're also
sure that they want your application to take up their entire screen.

Most browser users know how to make their windows fill the screen
if that's what they choose to do.


--
 
N

nitrospectide

Well, assuming that the philosophical issues have been sorted out,
what of the technical ones?
 
Y

Yorick

"nitrospectide" asks
Well, assuming that the philosophical issues have been sorted
out, what of the technical ones?

That 's impossible to answer. Assuming 2+2=5, how much is 1+1 then? (And
don't say it depends on what Big Brother wants, we are not living in 1984
anymore, this is not political question, but simply a mathematical one.) The
meaning behind the words of the answer previously given, should tell you
something.
hth
Yorick
http://www.yorick.onlyfools.com/
 
N

nitrospectide

So... even in a controlled environment, with consenting adults, where
someone explicitly clicks a "Go Full Screen" button... even then this
is some sort of morally reprehensible act?

I'm not sure I follow.
 
L

Lee

nitrospectide said:
So... even in a controlled environment, with consenting adults, where
someone explicitly clicks a "Go Full Screen" button... even then this
is some sort of morally reprehensible act?

I'm not sure I follow.

The reason it's hard to follow is that you're not posting correctly.
You should always quote enough of the thread to allow people to
understand the context without having to read the thread from the
beginning.

Do you know of a browser that doesn't already have a "Go Full Screen"
button? Why would you ever have to provide one yourself?


--
 
R

RobG

I am a designer who is pushing hard to use standards compliant best
practices in all of my web work. Javascript is an area where I feel
pretty ignorant, and don't know how to tell what is compliant with
current best practices, and what isn't. Is there some sort of
validator like the w3c has for xhtml and css? Are there things to look
for in code that tell you if it's up to snuff or not?

For instance, i was given this delightfully concise script for
resizing a browser to full screen. I find it to be elegant, and to-the-
point (much cleaner than the code forking stuff I'd used in the past).
However, it only works in IE and Firefox. No Opera. No Netscape. Is
the fix simple and small, or do I have to go back to the complicated
scripts of the past?

Here's the code:

self.moveTo(0,0)
self.resizeTo(screen.availWidth,screen.availHeight)

screen.availWidth/Height are supported by all major browsers, however
they are not part of any standard and may not be supported by some.
For general help on what you are trying to achieve:

<URL: http://www.quirksmode.org/js/winprop.html >

However, consider carefully why you want to re-size or move the
window. Browsers already have either a "full screen" or "optimise
size" button (depending on platform) that is guaranteed to work
without any scripting. A script that resizes or moves a browser
window is guaranteed to fail at least some of the time in browsers
that either can't run the script or where the user has selected to
prevent scripts from moving or resizing windows (Mozilla and Firefox
at least). While the script at the link above tries very hard to be
compatible with as many browsers as possible, it doesn't work in
Safari 2.0.4 or Firefox as I have it configured.

Finally, at work I use a 61cm sreen at 1920x1200px. I really don't
want any script telling my browser to fill the screen - nor do most
people with dual screens.

To be "compliant with current best practices", don't attempt it at
all. :)
 
0

00steve

"nitrospectide" asks


That 's impossible to answer. Assuming 2+2=5, how much is 1+1 then? (And
don't say it depends on what Big Brother wants, we are not living in 1984
anymore, this is not political question, but simply a mathematical one.) The
meaning behind the words of the answer previously given, should tell you
something.
hth
Yorickhttp://www.yorick.onlyfools.com/

LOL- comp.lang.javascript "the home of arsey responses!"
 
D

Dr J R Stockton

Thu said:
Do you know of a browser that doesn't already have a "Go Full Screen"
button? Why would you ever have to provide one yourself?

I don't recall one in IE4; I don't see one in IE6.

In IE6 at least, F11 will do it, but that's not a visible button. For
some types of user, only visible controls will do.



On re-sizing in general : it's clearly arrogant, for most pages, to go
full-screen onLoad. But, in particular cases, it can certainly be
appropriate to allow the user to select a particular width.



For example, I have a page with an image 15*8388 pixels (more-or-less in
the right margin) and a parallel optional <pre> about 5 ex wide and as
deep as the user chooses (more-or-less in the left margin); it also has
other images and boxes. I think I've now got it more-or-less
satisfactory at any window-width that would accommodate a <pre> about 60
characters wide; but it might certainly be good to provide a button to
make the page look, as much as possible, like the author habitually
uses.

It's <URL:http://www.merlyn.demon.co.uk/gravity4.htm> ; a pity that one
can no longer ask Alan Flavell to review it.
 
L

Lee

Dr J R Stockton said:
I don't recall one in IE4; I don't see one in IE6.

OK, so I'm being sloppy about what I call "the browser".
Do you know of a window manager that doesn't provide a button
to expand a normal window to fill the screen?

For example, I have a page with an image 15*8388 pixels (more-or-less in
the right margin) and a parallel optional <pre> about 5 ex wide and as
deep as the user chooses (more-or-less in the left margin); it also has
other images and boxes. I think I've now got it more-or-less
satisfactory at any window-width that would accommodate a <pre> about 60
characters wide; but it might certainly be good to provide a button to
make the page look, as much as possible, like the author habitually
uses.

I have, in the past, provided a button to "set favorite view", that
restores the window size/location and certain CSS settings that the
visitor has previously saved. I don't see any harm in allowing the
option of choosing the author's favorites, instead.


--
 
L

Lee

nitrospectide said:
Thank you. It's nice to get a helpful answer.

Sometimes, the best way to help somebody is to tell them to scrap
their idea. People with bad ideas rarely recognize that as help,
though.


--
 
D

Dr J R Stockton

In comp.lang.javascript message <[email protected]>,
Are you actually saying that the View drop-down menu in MSIE 6 does not
offer to resize to full screen with "Full Screen F11"?

No, that is not a button. Lee was referring to buttons. For many Web
users, the only controls they know are the ones which are both
permanently visible and self-explanatory.
Did you know that empowered users can customize a toolbar to have a
Full Screen button thanks to a right-click on the toolbar and then
choosing Customize toolbar?

I cannot do so in practice, because the preferred width of my browser
window will not show any more buttons, and I don't want to hide any that
now show.
I believe the real issue is to empower users, and not to create and to
duplicate browser functionalities which already available in the
browser interface.

No, the real issue is to empower users so that they will be able to do,
as far as can be predicted, what they are most likely to need to do.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top