Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

<noscript><img /> in <head> valid?

I'd like some advice on whether the following code is valid in the <head> section of a website:

<noscript><img src="http://bux1le001.com/images/track/26351.png?trk_user=26351&trk_tit=jsdisabled&trk_ref=jsdisabled&trk_loc=jsdisabled" height="0px" width="0px" style="display:none;" /></noscript>

I have been asked to add it to a website I look after but as far as I'm aware this means if JavaScript is disabled it will display an image to warn the user, but if I put it in the <head> section it won't work will it?

like image 520
mtwallet Avatar asked May 23 '14 08:05

mtwallet


1 Answers

It is not valid (noscript elements are not allowed in the head before HTML 5, and may not contain images when they are in the head in HTML 5), but it will probably "work" as browsers perform a lot of error recovery. You might not get the DOM you are expecting though.

like image 168
Quentin Avatar answered Oct 20 '22 18:10

Quentin