Document.body不存在. Modernizr连字符测试需要它 [英] Document.body doesn't exist. Modernizr hyphens test needs it
问题描述
我希望我能解释造成此问题的原因.我搜索了,根本不知道.当我在项目之间移动此Foundations,Red等框架时,它倾向于遵循.任何建议都会有用.
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.
推荐答案
您正在<head>
中没有加载您的自定义Modernizr库(使用Hyphenator,这会导致问题).存在,因此出现错误.
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.
一个明显的解决方案是将Modernizr库的加载移至页面底部(在<body>
内或之后),尽管此建议这样做可能会导致一些问题.如果是这样,请尝试将Hyphenator与Modernizr库分开,然后分别加载.
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.
这篇关于Document.body不存在. Modernizr连字符测试需要它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!