Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

<noscript> in <head>

Tags:

html

xhtml

Am I allowed to place <noscript> in the <head>?

like image 714
Steve Avatar asked Oct 31 '08 08:10

Steve


People also ask

Can noscript go in the header?

The <noscript> tag defines an alternate content for users that have disabled scripts in their browser or have a browser that doesn't support script. Whilst it can be used in both the <head> and the <body>, when used inside the <head>, it must contain only <link>, <style>, and <meta> elements.

What does noscript mean?

<noscript>: The Noscript element The <noscript> HTML element defines a section of HTML to be inserted if a script type on the page is unsupported or if scripting is currently turned off in the browser.

Where do you put noscript?

The most useful place to use the noscript element is in the head of the page where it would be able to selectively determine what stylesheet and meta elements get applied to the page as the page is loading rather than having to wait until the page is loaded.

Can you put an IMG tag in head?

Yes. I tested in FireFox and Chrome and it was requested. Show activity on this post.


2 Answers

According to the XHTML Strict DTD, no, you're allowed script, style, meta, link, object, title and base only. Transitional allows isindex as well, but still not noscript.

like image 188
Greg Avatar answered Nov 07 '22 19:11

Greg


Using the HTML5 Doctype, I have a declaration in my <head> with a <link> element that points to a no-js.css stylesheet. It validates and seems to work fine.

like image 36
Kevin C. Avatar answered Nov 07 '22 20:11

Kevin C.