简体   繁体   中英

MIME type error with .js in all browser in a view of SharePoint 2013

I have a error when the file .js is loaded, but this error ocurred in all browsers, I try clean the file .js but the error is not in the code, I discovered this error is in header, but I no have idea to how fix this. This erro ocurred only in a view of list of SharePoint 2013.

Error:

Refused to execute script form 'url/.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.

There has been a recent change to at least the Chromium platform to enforce strict MIME type checking. When my Chrome browser updated, my web site suddenly started failing because I had not properly set the MIME types of .js files. Setting the MIME type properly on the server fixed my issue.

The insidious part of this, at least for me, is that there were no warning messages in the browser console when this occurs - my JavaScript will just silently fail to execute.

If you can discover which .js file in your SharePoint distribution is causing the problem, and set it's MIME type properly, that should fix the issue. Might also be a server configuration setting somewhere in the bowels of SharePoint administration.

我之前遇到过此问题(因为从不同站点复制文件),并通过签出并签入文件解决了

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM