5

每隔一段时间,当我加载我的网站大约五分之一时,它无法加载网站,并且在 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 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 文件的方式吗?

4

1 回答 1

0

这似乎与JQuery中发生的类似问题有关

这完全是因为 DOM 没有准备好,并且由于 DOM 没有完全加载,所以会发生这个错误,这也解释了你提到的“随机”行为。

如果您还没有这样做,请尝试在页面末尾添加脚本或某种延迟加载:

顺便说一句,似乎微软拒绝了这方面的帖子,它并不认为这是一个错误:

https://connect.microsoft.com/IE/feedback/details/792880/document-readystat

于 2014-01-09T21:48:43.517 回答