the HTML script tag and non-JS content - Firefox

后端 未结 3 568
青春惊慌失措
青春惊慌失措 2021-01-06 17:09

It appears this code will request the file in Chrome and IE but not in Firefox.



        
3条回答
  •  被撕碎了的回忆
    2021-01-06 17:41

    The canonical way to specify script is

    
    

    or

    
    

    There is no reason the browser should load unknown mime into a script tag and it will be strictly browser specific whether or not it will allow/ignore the type attribute

    It would be a matter of testing to see what the browser will do if you actually send

    content-type:text/javascript

    regardless of type attribute

提交回复
热议问题