我需要在网页中加入一个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>
怎么做?
Ehe*_*Tov 87
把它放在你的玉文件中:
script(src="/Scripts/jquery.timeago.js")
Anu*_*ngh 10
您可以将此代码放在您的jade文件中:
   script(type='text/javascript' src='public/vendor/jquery/jquery.min.js')
此外,如果您想在jade文件中包含内联j,您还可以执行以下操作:
script(type="text/javascript").
console.log('hello world');
| 归档时间: | 
 | 
| 查看次数: | 61886 次 | 
| 最近记录: |