473,387 Members | 1,455 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Dom compliance

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 )

Mar 22 '07 #1
16 1260
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.availHeigh t)
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.
--

Mar 22 '07 #2
Well, assuming that the philosophical issues have been sorted out,
what of the technical ones?

Mar 22 '07 #3
"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/
Mar 22 '07 #4
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.

Mar 22 '07 #5
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?
--

Mar 22 '07 #6
On Mar 23, 4:08 am, "nitrospectide" <jay.mcdon...@hexatrope.com>
wrote:
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. :-)
--
Rob

Mar 22 '07 #7
nitrospectide said the following on 3/22/2007 2:08 PM:
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 JS Validation: <URL: http://www.jslint.com/>
Best Practices: <URL: http://www.JavascriptToolbox.com/bestpractices/>
General JS Information: <URL: http://jibbering.com/faq/index.html

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
JSLint: http://www.jslint.com/
Mar 22 '07 #8
On 22 Mar, 19:07, "Yorick" <n...@thank.youwrote:
"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
Yorickhttp://www.yorick.onlyfools.com/
LOL- comp.lang.javascript "the home of arsey responses!"

Mar 23 '07 #9
In comp.lang.javascript message <et********@drn.newsguy.com>, Thu, 22
Mar 2007 13:24:14, Lee <RE**************@cox.netposted:
>
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 <preabout 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 <preabout 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.

--
(c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 MIME.
Web <URL:http://www.merlyn.demon.co.uk/- FAQqish topics, acronyms & links;
Astro stuff via astron-1.htm, gravity0.htm ; quotings.htm, pascal.htm, etc.
No Encoding. Quotes before replies. Snip well. Write clearly. Don't Mail News.
Mar 23 '07 #10
On Mar 22, 5:55 pm, Randy Webb <HikksNotAtH...@aol.comwrote:
For JS Validation: <URL:http://www.jslint.com/>
Best Practices: <URL:http://www.JavascriptToolbox.com/bestpractices/>
General JS Information: <URL:http://jibbering.com/faq/index.html
Thank you. It's nice to get a helpful answer.
Mar 23 '07 #11
Lee
Dr J R Stockton said:
>
In comp.lang.javascript message <et********@drn.newsguy.com>, Thu, 22
Mar 2007 13:24:14, Lee <RE**************@cox.netposted:
>>
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.
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 <preabout 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 <preabout 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.
--

Mar 23 '07 #12
Lee
nitrospectide said:
>
On Mar 22, 5:55 pm, Randy Webb <HikksNotAtH...@aol.comwrote:
>For JS Validation: <URL:http://www.jslint.com/>
Best Practices: <URL:http://www.JavascriptToolbox.com/bestpractices/>
General JS Information: <URL:http://jibbering.com/faq/index.html

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.
--

Mar 23 '07 #13
Dr J R Stockton said the following on 3/23/2007 9:56 AM:
In comp.lang.javascript message <et********@drn.newsguy.com>, Thu, 22
Mar 2007 13:24:14, Lee <RE**************@cox.netposted:
>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.
Right click on your toolbar, Customize Toolbars and you can add it. I
don't recall exactly where in IE6 it is (I have IE7).

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Mar 23 '07 #14
nitrospectide wrote :
So... even in a controlled environment, with consenting adults, where
someone explicitly clicks a "Go Full Screen" button...
Do not redeclare, redefine and recode what a browser application can
already do. Instead invite people to discover, to learn how to use the
application they already have. Do not duplicate the already-available
browser functionalities.

In MSIE 6+: View/Full Screen F11

In Firefox 1+: View/Full Screen F11

In Opera 7+: View/Full Screen F11

etc.

The reverse would be to redefine and recode every single interface
button (Back, Refresh, Resize text, Copy to clipboard, Back to top,
Stop, etc.) of the browser into the webpage. Some people do this and
it's not only a waste of time but it subconsciously leads users to trust
more web applications (remember phishing hacks) when they should not,
when they should get to know, learn their browser applications instead.

Gérard
--
Using Web Standards in your Web Pages (Updated Dec. 2006)
http://developer.mozilla.org/en/docs...your_Web_Pages
Mar 25 '07 #15
Dr J R Stockton wrote:
In comp.lang.javascript message <et********@drn.newsguy.com>, Thu, 22
Mar 2007 13:24:14, Lee <RE**************@cox.netposted:
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.
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"?

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 believe the real issue is to empower users, and not to create and to
duplicate browser functionalities which already available in the browser
interface.

Gérard
--
Using Web Standards in your Web Pages (Updated Dec. 2006)
http://developer.mozilla.org/en/docs...your_Web_Pages
Mar 25 '07 #16
In comp.lang.javascript message <13*************@corp.supernews.com>,
Sun, 25 Mar 2007 12:53:02, Gérard Talbot <ne***********@gtalbot.org>
posted:
>Dr J R Stockton wrote:
>In comp.lang.javascript message <et********@drn.newsguy.com>, Thu, 22
Mar 2007 13:24:14, Lee <RE**************@cox.netposted:
>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.

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.

--
(c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 MIME.
Web <URL:http://www.merlyn.demon.co.uk/- FAQish topics, acronyms, & links.
Proper <= 4-line sig. separator as above, a line exactly "-- " (SonOfRFC1036)
Do not Mail News to me. Before a reply, quote with ">" or "" (SonOfRFC1036)
Mar 25 '07 #17

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

119
by: rhat | last post by:
I heard that beta 2 now makes ASP.NET xhtml compliant. Can anyone shed some light on what this will change and it will break stuff as converting HTML to XHTML pages DO break things. see,...
100
by: Roose | last post by:
Just to make a tangential point here, in case anyone new to C doesn't understand what all these flame wars are about. Shorthand title: "My boss would fire me if I wrote 100% ANSI C code" We...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.