Connecting Tech Pros Worldwide Help | Site Map

Site with killer JavaScript Degradation?

 
LinkBack Thread Tools Search this Thread
  #1  
Old January 24th, 2007, 03:15 AM
-Lost
Guest
 
Posts: n/a
Default Site with killer JavaScript Degradation?

I cannot for the life of me remember the site name, but I believe it was the site of one
of the regular posters here or perhaps in comp.lang.java.javascript. Anyway...

The site in particular boasted about accessible JavaScript or proper JavaScript
degradation, something along those lines. I remember specifically when I visited the site
without JavaScript enabled it displayed the entire "menu" in a vertical fashion along the
left side of the page without destroying the placement of the rest of the content. With
JavaScript enabled it was a horizontal menu spanning the top of the page (I think).

I realize this is ridiculously vague, but if anyone has any idea about the site, please
provide the URL. I'd love to check out the design and code aspect of it.

Alrighty... so, thanks guys/gals!

-Lost



  #2  
Old January 24th, 2007, 06:55 AM
Laurent Bugnion [MVP]
Guest
 
Posts: n/a
Default Re: Site with killer JavaScript Degradation?

Hi,

-Lost wrote:
Quote:
I cannot for the life of me remember the site name, but I believe it was the site of one
of the regular posters here or perhaps in comp.lang.java.javascript. Anyway...
>
The site in particular boasted about accessible JavaScript or proper JavaScript
degradation, something along those lines. I remember specifically when I visited the site
without JavaScript enabled it displayed the entire "menu" in a vertical fashion along the
left side of the page without destroying the placement of the rest of the content. With
JavaScript enabled it was a horizontal menu spanning the top of the page (I think).
>
I realize this is ridiculously vague, but if anyone has any idea about the site, please
provide the URL. I'd love to check out the design and code aspect of it.
>
Alrighty... so, thanks guys/gals!
>
-Lost
It's a complex subject, but there are a few ground rules that you can
follow. Don't forget that some browsers have also limited CSS support,
so you should think not only of what happens when JavaScript is off, but
also when CSS is off. I might be a good idea to check your site in
mobile browsers too, for example Blazer or Xiino for Palm OS. The result
is sometimes suprising (for example, Blazer supports a subset of
JavaScript. It supports document.write, for example, but not
document.getElementById)

- Always display the elements first, and hide them with JavaScript. This
was, you ensure that the element is displayed if JavaScript is off. That
sounds like an obvious statement, but for example DotText (a .NET blog
system) doesn't follow it, which is a pain.
Of course, it's the contrary for elements which must only be displayed
if script is active. For example, some "image buttons" are only active
when JavaScript is on, so you should hide them first and display them
using JavaScript.

- Use feature detection instead of browser detection. If you need
getElementById somewhere, test for it first:

if ( document.getElementById )
{
document.getElementById( "myDiv" ).style.top = "...";
}

- Use CSS. When using position: absolute for elements, think about the
order in which you place them on your HTML page, since they will appear
in that same order if CSS positioning if not supported.

- Try to use JavaScript to improve the user experience, but not for
critical functionality. Often, you must duplicate functionality on the
client and on the server: On the client to avoid unnecessary postbacks;
on the server because it's the only place where you're sure that the
code will be executed.

- Use links in that form:
<a href="nojs.html"
onclick="doSomething();return false;">Something</a>

This ensures that the user will see something if JavaScript is off when
he clicks the link. Using "#" is bad practice. The page "nojs.html"
should explain what just happened, for example
http://www.galasoft-lb.ch/nojs.html

- If you use JavaScript for navigation too, don't forget to include the
target page's URL in the HREF:

<a href="nextPage.html"
onclick="navigateTo( this.href );return false;">Go to next page</a>

I try to do my best and offer a functional site with JavaScript off
(www.galasoft-lb.ch). However, I am not satisfied yet (for example, the
menu on my page may hide part of the page's content if JavaScript is
off, but CSS positioning is supported. I must find a better solution here).

HTH,
Laurent
--
Laurent Bugnion [MVP ASP.NET]
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
  #3  
Old January 25th, 2007, 03:55 PM
-Lost
Guest
 
Posts: n/a
Default Re: Site with killer JavaScript Degradation?

"Laurent Bugnion [MVP]" <galasoft-lb@bluewin.chwrote in message
news:45b70e5a$1_2@news.bluewin.ch...
Quote:
Hi,
<SNIPPED>

Thanks a bunch, Laurent!

(You may remember me... you sent me the CommTest source a while back. Which, by the way,
I never could quite get to work as is. Then again, I am fairly Java illiterate.)

And lastly, by the way, whatever happened to:

"On another note, I got the firm's permission to publish our JavaScript programming
guidelines. I want to prepare them first, I'll publish them as soon as I get to it,
promised."

I would *love* to get my hands on that.

-Lost


  #4  
Old January 26th, 2007, 08:15 AM
Laurent Bugnion [MVP]
Guest
 
Posts: n/a
Default Re: Site with killer JavaScript Degradation?

Hi,

-Lost wrote:
Quote:
"Laurent Bugnion [MVP]" <galasoft-lb@bluewin.chwrote in message
news:45b70e5a$1_2@news.bluewin.ch...
Quote:
>Hi,
>
<SNIPPED>
>
Thanks a bunch, Laurent!
>
(You may remember me... you sent me the CommTest source a while back. Which, by the way,
I never could quite get to work as is. Then again, I am fairly Java illiterate.)
I remember you well. Thanks to you I found out that my new ISP refused
to serve .java files (the previous one served them as text). It makes
sense, since the new ISP is .NET 2 enabled, and in .NET 2, you may copy
source files to the server to let them be compiled on the fly.

Sorry you didn't get it to work. The concept is not really difficult,
the reason it works is that all applets in a web browser run in the same
process (and even the same AppDomain apparently), so they can share
static members.

Quote:
And lastly, by the way, whatever happened to:
>
"On another note, I got the firm's permission to publish our JavaScript programming
guidelines. I want to prepare them first, I'll publish them as soon as I get to it,
promised."
>
I would *love* to get my hands on that.
I know. I will get to it as soon as I can. I have been just too busy
lately. I put that on my priority list, I promise.

Quote:
-Lost
Greetings,
Laurent
--
Laurent Bugnion [MVP ASP.NET]
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
  #5  
Old January 27th, 2007, 08:45 AM
pcx99
Guest
 
Posts: n/a
Default Re: Site with killer JavaScript Degradation?

-Lost wrote:
Quote:
I cannot for the life of me remember the site name, but I believe it was the site of one
of the regular posters here or perhaps in comp.lang.java.javascript. Anyway...
>
The site in particular boasted about accessible JavaScript or proper JavaScript
degradation, something along those lines. I remember specifically when I visited the site
without JavaScript enabled it displayed the entire "menu" in a vertical fashion along the
left side of the page without destroying the placement of the rest of the content. With
JavaScript enabled it was a horizontal menu spanning the top of the page (I think).
>
I realize this is ridiculously vague, but if anyone has any idea about the site, please
provide the URL. I'd love to check out the design and code aspect of it.
>
Alrighty... so, thanks guys/gals!
>
-Lost
>
>


A List Apart requires all their tutorials to degrade gracefully. That's
probably what you were thinking of since you mentioned menus.

http://alistapart.com/


--
http://www.hunlock.com -- Musings in Javascript, CSS.
$FA
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.