This is a discussion on "graceful degradation" within the JavaScript Forum section. This forum, and the thread "graceful degradation are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
graceful degradation
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
graceful degradation
How do you specify when the website should use js and when to use an alternative? or should both options always be available?
Thanks |
|
|
|
||||
|
Re: graceful degradation
what do you mean by alternate? The <noscript> tag will hide it's content if the browser has javascript enabled. But NEVER, EVER make your site rely completely on javascript. Always have a backup. Many modern sites do this, but I can't figure out why.
__________________
echo "Take it easy, ".$CloudedVision; .links { site: other-road-design; blog: only-nerds-allowed; project: resource-fish; organization: ARMIES6; } <quote>"I think it's wrong that only one company makes the game Monopoly" - <name>Steven Wright</name></quote>
Last Blog Entry: More Cheat Sheets (Jul 12th, 2008)
|
|
|||
|
Re: graceful degradation
When js is enabled, a site will display functions that are not present when js is disabled and vice versa?
So you say it is simple a question of adding <noscript> tag to a div? And so the <noscript> tag is back up? Last edited by Oak; Feb 11th, 2008 at 21:10. |
|
||||
|
Re: graceful degradation
Ya. If a browser has javascript enabled, it will ignore everything in the noscript tag. If javascript is off, the noscript tag's content will be displayed. If the browser is so old it doesn't even know what javascript is, it'll think the noscript tag is an error and ignore it, displaying its contents.
If you have a link that is runs a javascript function (let's say AJAX) write it like this:
__________________
echo "Take it easy, ".$CloudedVision; .links { site: other-road-design; blog: only-nerds-allowed; project: resource-fish; organization: ARMIES6; } <quote>"I think it's wrong that only one company makes the game Monopoly" - <name>Steven Wright</name></quote>
Last Blog Entry: More Cheat Sheets (Jul 12th, 2008)
Last edited by CloudedVision; Feb 11th, 2008 at 20:36. |
|
|||
|
Re: graceful degradation
Ha.. ok thanks, that is very clear.
Though I don't see the noscript tag in your code ? or is this another way of doing it? |
|
||||
|
Re: graceful degradation
The noscript would be something like this:
__________________
echo "Take it easy, ".$CloudedVision; .links { site: other-road-design; blog: only-nerds-allowed; project: resource-fish; organization: ARMIES6; } <quote>"I think it's wrong that only one company makes the game Monopoly" - <name>Steven Wright</name></quote>
Last Blog Entry: More Cheat Sheets (Jul 12th, 2008)
|
|
|||
|
Re: graceful degradation
Quote:
But generally, if I can, I'd build a site from the ground up. No script, no styles. Just headers, and paragraphs, and bullets, and etc. Then add on. But if it gets to a point where the add-on really adds a lot of 'thin client' functionality, I think it's fair to mention - turn on javascript - in a noscript tag on each page. I prefer to surf with Firefox 2. And there's an add-in called, NoScript. It's not the end-all and ideal of security. But it ain't half bad. And until you allow the site you are viewing to run scripts, you can see what it is like without. Can be revealing. Some that redirect for subscribers, and such - they won't even display a thing. What's the ultimate solution - a yet as unpopular or yet to be popularized app that handles all things web, to compete with browsers and 'platforms'? I don't know. Right now, it's the browser, so much so that M$ even basically reformed its IE team instead of going just with the OS/platform. |
|
||||
|
Re: graceful degradation
Take godaddy.com for example. disable javascript and half the links won't work. thats definitely something you want to steer away from.
__________________
echo "Take it easy, ".$CloudedVision; .links { site: other-road-design; blog: only-nerds-allowed; project: resource-fish; organization: ARMIES6; } <quote>"I think it's wrong that only one company makes the game Monopoly" - <name>Steven Wright</name></quote>
Last Blog Entry: More Cheat Sheets (Jul 12th, 2008)
|
![]() |
| Thread Tools | |
|
|