我需要包含一個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