views:

397

answers:

2

I found some good cons here.

  • The noscript tag only detects whether the browser has JavaScript enabled or not. If JavaScript is disabled in the Firewall rather than in the browser then the JavaScript will not run and the content of the noscript tag will not be displayed.

    • Many JavaScripts are dependent on a specific feature or features of the language being supported in order for them to be able to run (for example document.getElementById). Where the required features are not supported the JavaScript is unable to run but since JavaScript itself is supported the noscript content will not be displayed.
    • The most useful place to use the noscript tag is in the head of the page where it would be able to selectively determine what stylesheet and meta tags get applied to the page as the page is loading rather than having to wait until the page is loaded. Unfortunately the noscript tag is only valid within the body of the page and so cannot be used in the head.
    • The noscript tag is a block level element and therefore can only be used to display entire blocks of content when JavaScript is disabled. It cannot be used inline.
    • Ideally, web pages should use HTML for the content, CSS for the appearance, and JavaScript for the behaviour. Using the noscript tag is applying a behaviour from within the HTML rather than applying it from JavaScript.

Source: http://javascript.about.com/od/reference/a/noscriptnomore.htm

I very much agree on last point. Is there a way to make and add external <noscript> file? Should we place in ?

A: 

There's one thing that <noscript> is great for: displaying a message to users who have Javascript disabled. Javascript-diabled browsers are a small minority of the web-browsing public. <noscript> gives developers a simple and elegant way to warn these users about a lack of functionality.

pygorex1
yes u r right but where we should put in <head> or in <body>?
metal-gear-solid
@Jitendra: From HTML401 spec (http://www.w3.org/TR/html4/struct/global.html#edef-HEAD), you cannot put a <NOSCRIPT> element in a HEAD. Although you can put SCRIPT in HEAD or BODY.
Ian Boyd
@ian Boyd - +1 forgood info but if we include this in body then it will against the content and behavior separation
metal-gear-solid
@Jitendra: i'm not really sure what that means; so i'll just say that you're not allowed to have a <NOSCRIPT> element anywhere except in the <BODY>
Ian Boyd
+4  A: 

It's better to have the default be non-javascript, and then let a javascript code overwrite with a javascript enabled page. Doesn't have to be much. Can just be a display:none; block, which is then set to display:block; by javascript, and vice versa for the non-js page.

Tor Valamo
it's a good idea
metal-gear-solid