Include JavaScript file in HTML won't work as [removed]

前端 未结 3 884
盖世英雄少女心
盖世英雄少女心 2021-01-03 20:24

I\'d like to include a javascript file on every page of a site. I can do this with:

         


        
3条回答
  •  醉梦人生
    2021-01-03 21:14

    HTML doesn't support self closing tags. If you want to use them you need to use an xml based doctype AND serve the file as xml.

    XHTML or the xml serialisation of html5 would both work.

    Here is an example:

    
    
    
      
        XHTML5 Template
        
        
    
                                     
                  
提交回复
热议问题