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

4.7k views Asked by At

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?

1

There are 1 answers

0
Quentin On BEST ANSWER

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.