IE 9偶尔会加载javascript资源失败
每隔一段时间,当我加载我的网站时,大约有五分之一的网站无法加载,在IE 9控制台中,它会说:IE 9偶尔会加载javascript资源失败,javascript,internet-explorer,internet-explorer-9,requirejs,Javascript,Internet Explorer,Internet Explorer 9,Requirejs,每隔一段时间,当我加载我的网站时,大约有五分之一的网站无法加载,在IE 9控制台中,它会说: SCRIPT5007: Unable to get value of the property 'normalize': object is null or undefined require.js, line 929 character 25 SCRIPT5007: Unable to get value of the property 'normalize': object is null or
SCRIPT5007: Unable to get value of the property 'normalize': object is null or undefined
require.js, line 929 character 25
SCRIPT5007: Unable to get value of the property 'normalize': object is null or undefined
require.js, line 929 character 25
SCRIPT5007: Unable to get value of the property 'extend': object is null or undefined
Module.js?ts=@@timestamp, line 52 character 3
SCRIPT5007: Unable to get value of the property 'normalize': object is null or undefined
require.js, line 929 character 25
SCRIPT5007: Unable to get value of the property 'View': object is null or undefined
View.js?ts=@@timestamp, line 8 character 3
SCRIPT5007: Unable to set value of the property 'Validation': object is null or undefined
backbone.validation.js?ts=@@timestamp, line 15 character 3
SCRIPT5007: Unable to get value of the property 'extend': object is null or undefined
Class.js?ts=@@timestamp, line 10 character 3
SCRIPT5007: Object expected
hbs.js?ts=@@timestamp, line 143 character 15
SCRIPT5007: Object expected
hbs.js?ts=@@timestamp, line 143 character 15
SCRIPT5007: Object expected
hbs.js?ts=@@timestamp, line 143 character 15
SCRIPT5022: Load timeout for modules: css!lib/foundation/style_unnormalized2,css!lib/icon-font/fontcustom_unnormalized3,css!lib/icon-font/icon-font_unnormalized4,hbs!modules/header/HeaderTemplate_unnormalized5,css!modules/header/HeaderStyle_unnormalized6,hbs!lib/components/avatar/AvatarTemplate_unnormalized7,css!lib/components/avatar/AvatarStyle_unnormalized8,hbs!modules/login/LoginTemplate_unnormalized9,css!modules/login/LoginStyle_unnormalized10,hbs!modules/header/HeaderTemplate,hbs!lib/components/avatar/AvatarTemplate,hbs!modules/login/LoginTemplate
http://requirejs.org/docs/errors.html#timeout
require.js, line 1758 character 9
令人困惑的是,这种情况只是偶尔发生——这可能是我需要javascript文件的方式吗?这似乎与发生在 这都是因为DOM没有准备好,而且由于DOM没有完全加载,因此会发生此错误,这也解释了您提到的“随机”行为 如果您尚未完成此操作,请尝试在页面末尾添加脚本或进行某种延迟加载:
查看您如何加载文件会很有用。显示一些代码?可能是模块依赖项设置不正确?这听起来像是您的依赖项设置不正确。5次中有4次,您的浏览器加载脚本的速度可能足够快,可以正常工作,但有时却无法正常工作。和其他事情一样:提问时请张贴代码,否则很难提供帮助。