Is it wrong to place the [removed] tag after the </body> tag?

前端 未结 8 1113
长情又很酷
长情又很酷 2020-11-22 06:12

How wrong is it to place the script tag after the closing tag of the body (). ?


  ....
  
     ....
  <         


        
8条回答
  •  轮回少年
    2020-11-22 06:25

    As Andy said the document will be not valid, but nevertheless the script will still be interpreted. See the snippet from WebKit for example:

    void HTMLParser::processCloseTag(Token* t)
    {
        // Support for really broken html.
        // we never close the body tag, since some stupid web pages close it before 
        // the actual end of the doc.
        // let's rely on the end() call to close things.
        if (t->tagName == htmlTag || t->tagName == bodyTag 
                                  || t->tagName == commentAtom)
            return;
        ...
    

提交回复
热议问题