【发布时间】:2012-12-30 04:52:45
【问题描述】:
我需要在网页中包含一个 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用于将一个 pug 文件的内容包含到另一个文件中。script就是你要找的。span>