Chrome says “Resource interpreted as script but transferred with MIME type text/plain.”, what gives?

后端 未结 20 2730
眼角桃花
眼角桃花 2020-11-22 07:21

In FF and all, my javascript works fine. But in Chrome it gives this message:

Resource interpreted as script but transferred with MIME type text/plai

20条回答
  •  面向向阳花
    2020-11-22 08:00

    For Java Application servers such as Weblogic

    1) Make sure your weblogic.xml file is free of errors

    like this one:

        
    
        
            true
        
        MyWebApp
    
    

    2) Add a mime type for javascript to your web.xml file:

        ...
            
    
                
                js        
                application/javascript        
            
    
            
        ...
    

    This will also work for other Java containers - Tomcat etc. application/javascript is currently the only valid mime-type; others like text/javascript have been deprecated.

    3) You may need to clear up your browser cache or hit CTRL-F5

提交回复
热议问题