$(this).hide().parent().prepend("<img class='ajax-loader' src='ajax- loader.gif' height='14px' style='padding-left:7px;' alt='loading...'/ >");
This, obviously, is in the head tag. However, when I run it through the validator, it is returning an error: document type does not allow element "img" here . The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed). I want to avoid invalid markup; how can I get around this?