Dev.Opera - Follow the standards, break the rulesDev.Opera - Follow the standards, break the rules

Login

Lost password?

Forums » Article Discussions

Discuss the articles posted on Dev.Opera.

Note: You need to login to post in the forums. if you don't have an account you first need to sign up.

By fmpalinkas anchor Friday, 29. February 2008, 09:36:29

Replacing <noscript> with accessible, unobtrusive DOM/JavaScript

In this article, Frank Palinkas presents an accessible, unobtrusive replacement for <noscript>, built using HTML and DOM/JavaScript, which solves the problem of some older browsers not supporting <noscript> properly.

( Read the article )

By Stevie-D anchor Friday, 7. March 2008, 12:48:14

avatarAnother problem with using <noscript> is that some corporate networks and firewalls block some/all scripts. But because this is done behind the scenes, the web browsers think they are supporting Javascript (although they don't get to see very much of it), so correctly ignore then <noscript> element. But they don't run the script either, so the user gets nothing at all.

That's one of the reasons why "graceful degradation" is a bit of a misnomer - the only way to make really good, accessible websites with scripts and styles is through progressive enhancement.

By FataL anchor Friday, 14. March 2008, 23:17:31

avatarGreat! But so mutch code!..
I usually do like in this example:
http://rusrestaurant.com/tests/js-css/2/
I will add some interactive example soon.

By harkman anchor Monday, 31. March 2008, 23:55:21

avatarHello.

I was asking myself if there is a difference in performance if I use sth. like
div.parentNode.removeChild(div)
or
div.style.display = 'none';

Can anybody tell if there is a difference?
Any suggestions which way would be the better and why?

By renzaijh anchor Friday, 25. April 2008, 07:38:42

avatarHello there,

when implementing Frank's script, I noticed the 'noscript' contents appearing briefly when the page loads. Is there a workaround to totally hide the 'peekaboo' if scripts are enabled in web browsers?

Rgds,
Dan

By FataL anchor Friday, 25. April 2008, 18:27:16

avatarrenzaijh, you can take a look at my solution mentioned in my previous comment here. I think it's simple and bulletproof.

By fuge08 anchor Tuesday, 2. September 2008, 00:30:52

avatarRenzaijh, I found that if you wrap the noscript tags around the noscript div stated as the solution in this article, it does the trick of removing the "peekaboo" and degrades the same.

So it would look like:
<noscript><div id="noscript">your content</div><noscript>

Supporting browsers would render the noscript first hence hiding the content immediately.

Fatal, I really like your solution, it's very minimal and it seems to do the trick just as well if not better without the "peekaboo" affect Renzaijh was having.

Moderators: pepelsbey | dstorey | mcx | operadev | chrismills | shwetankdixit | brucelawson | iheni | andreasbovens | zibin | mollydotcom