我需要包含一个JavaScript文件到网页。我写了以下内容:Jade:如何包含一个JavaScript文件
include /../scripts/jquery.timeago.js
,但我得到
<script>/*
* timeago: a jQuery plugin, version: 0.8.2 (2010-02-16)
* @requires jQuery v1.2.3 or later
*
* Timeago is a jQuery plugin that makes it easy to support automatically
* updating fuzzy timestamps (e.g. "4 minutes ago" or "about 1 day ago").
*
* For usage and examples, visit:
* http://timeago.yarp.com/
*
* Licensed under the MIT:
* http://www.opensource.org/licenses/mit-license.php
*
* Copyright (c) 2008-2010, Ryan McGeary (ryanonjavascript -[at]- mcgeary [*dot*] org)
*/
(function($) {
....
</script>
的结果。但我需要:
<script src="/Scripts/jquery.timeago.js" type="text/javascript"></script>
如何做到这一点?
['includes'](https://pugjs.org/language/includes.html)用于将一个帕格文件的内容包含到另一个帕格文件中。 '脚本'是你正在寻找的。 – TheCrazyProgrammer