Document.body doesn't exist. Modernizr hyphens test needs it [closed]

和自甴很熟 提交于 2019-12-12 17:22:36

问题


I wish I could explain what's causing this issue. I've searched and simply have no idea. When I move this Foundations, Red, etc. framework between projects it tends to follow. Any advice would be useful.

http://goo.gl/HbTUL


回答1:


You're loading your customized Modernizr lib (with Hyphenator, which is causing the problem) in <head>, at a moment where <body> doesn't exist yet, hence the error.

An obvious solution would be to move the loading of the Modernizr lib to the bottom of your page (in or after <body>), although this suggests that doing that might cause some issues. If it does, try separating Hyphenator from the Modernizr lib and load it separately.



来源:https://stackoverflow.com/questions/15583390/document-body-doesnt-exist-modernizr-hyphens-test-needs-it

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!