Jade:如何包含一个javascript文件 [英] Jade: How to include a javascript file

查看:98
本文介绍了Jade:如何包含一个javascript文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在网页上添加一个javascript文件。我写了以下内容:

  include /../scripts/jquery.timeago.js 

但我得到

 < script> ; / * 
* timeago:jQuery插件,版本:0.8.2(2010-02-16)
* @requires jQuery v1.2.3或更高版本
*
*时间是一个jQuery插件,可以方便地自动支持
*更新模糊时间戳(例如4分钟前或约1天前)。
*
*有关用法和示例,请访问:
* http://timeago.yarp.com/
*
*在MIT下授权:
* http://www.opensource.org/licenses/mit-license.php
*
*版权所有(c)2008-2010,Ryan McGeary(ryanonjavascript - [at] - mcgeary [* dot *] org)
* /
(function($){
....
< / script>
pre>

作为结果,但我需要:

 < script src =/ Scripts / jquery.timeago.jstype =text / javascript>< / script> 

如何做?

解决方案

将其放在你的玉器文件中:



script(src =/ Scripts / jquery.timeago.js)


I need to include a javascript file to webpage. I write the following:

include /../scripts/jquery.timeago.js

but I get

<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>

as result. But I need:

<script src="/Scripts/jquery.timeago.js" type="text/javascript"></script>

How to do it?

解决方案

Put this in your jade file:

script(src="/Scripts/jquery.timeago.js")

这篇关于Jade:如何包含一个javascript文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆