"Application Cache manifest had an incorrect MIME type: text/plain."
一次又一次收到相同的消息,但我缓存了我的内容。 我遇到此问题的浏览器:IE9/10 和 Safari。 我的 Mozilla 和 chrome 可以正常输出。
代码:
<script type="text/javascript">
function logEvent(event) {
alert(event.type);
}
window.applicationCache.addEventListener('checking',logEvent,false);
window.applicationCache.addEventListener('noupdate',logEvent,false);
window.applicationCache.addEventListener('downloading',logEvent,false);
window.applicationCache.addEventListener('cached',logEvent,false);
window.applicationCache.addEventListener('updateready',logEvent,false);
window.applicationCache.addEventListener('obsolete',logEvent,false);
window.applicationCache.addEventListener('error',logEvent,false);
</script>
最佳答案
MIME 类型应该是 text/cache-manifest
。这在旧浏览器上是必需的。
This requirement was dropped from the specification some time ago, and no longer required by the latest versions of Chrome, Safari and Firefox, but you'll need the mime-type to work in older browsers and IE11.
关于javascript - Safari --> "Application Cache manifest had an incorrect MIME type: text/plain.",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20210616/