html5-boilerplate中文翻译 - 常见问题篇steemCreated with Sketch.

in #cn6 years ago (edited)

HTML5 Boilerplate 主页 | 目录

常见问题

  • 为什么把Google Analytics代码放到底部?Google建议将其放在 <head> 中。
  • 我如何将Bootstrap与HTML5 Boilerplate集成?
  • 每次发布HTML5 Boilerplate的新版本时,是否需要升级我的网站?
  • 在哪里可以获得支持问题的帮助?

为什么把Google Analytics代码放到底部?Google建议将其放在 <head> 中。

将它放在 <head> 中的主要优点是你可以跟踪用户的pageview,即使他们在完全加载之前离开页面。

关于我们的选择,这是来自Mathias Bynens的简单引用。

I should point out that it’s Google — not me — recommending to place this
script before all other scripts in the document. The only real advantage is to
catch a pageView call if your page fails to load completely (for example, if
the user aborts loading, or quickly closes the page, etc.). Personally, I
wouldn’t count that as a page view, so I actually prefer to place this script
at the bottom, after all other scripts. This keeps all the scripts together and
reinforces that scripts at the bottom are the right move. (Usually I
concatenate and minify all my scripts into one .js file — the GA snippet being
the suffix.)

译:我应该指出,Google - 而不是我 - 建议将此脚本放在文档中的所有其他脚本之前。 唯一真正的优点是如果您的页面无法完全加载(例如,如果用户中止加载或快速关闭页面等),则可以捕获pageView调用。 就个人而言,我不会将其视为页面视图,所以我实际上更喜欢在所有其他脚本之后将此脚本放在底部。 这将使所有脚本保持一致,并强化底部的脚本是正确的。 (通常我将所有脚本连接起来并将其缩小为一个.js文件 - 作为后缀的GA代码段。)

我如何将Bootstrap与HTML5 Boilerplate集成?

这是Nicolas Gallagher写的关于HTML5 Boilerplate和Bootstrap如何相互补充的内容。

每次发布HTML5 Boilerplate的新版本时,是否需要升级我的网站?

不需要,这和一旦房子建成,你通常不会改造房子的地基一样。但是,没有什么能阻止你尝试最新的改变,但你必须评估这样做的成本/收益。

在哪里可以获得支持问题的帮助?

StackOverflow上请求帮助。

注:翻译中的链接现在还是原文中的链接(链接内容还是英文文档),当翻译到相关文章时,会进行相应替换。最后全部翻译完成时,就不会再有这种情况发生,到时大家可以到github上查看完整文档,现在还请大家多多谅解。

What you want, Go after It.


https://steemit.com 首发。感谢阅读。

欢迎Follow, Upvote, Reply, Resteem (repost)激励我创作更多更好的内容。

@syt

Coin Marketplace

STEEM 0.30
TRX 0.12
JST 0.036
BTC 66992.58
ETH 3460.53
USDT 1.00
SBD 4.68