代码工作非常好,但是当Charles代理在后台运行时,我会看到Chrome和Firefox中的错误。Charles代理在默认设置下运行。
未明错误:模块的加载超时: jQuery、车把 http://requirejs.org/docs/errors.html#timeout require.js:8
F require.js:8
C require.js:13
(匿名函数)
OS: OS X 10.8.4
Charles: v 3.7
Chrome : 28.0.1500.71
Firefox : 22.0 发布于 2013-09-16 14:30:48
结果发现这个问题与主机文件有关。Requirejs抛出超时是因为本地主机需要很长时间才能解决。在将主机文件更新到以下内容后,一切正常:
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost.localdomain
127.0.0.1 localhost
127.0.0.1 username.lmuk.local
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost更多信息可用here。
https://stackoverflow.com/questions/17859933
复制相似问题