1

我开始使用 jquery 插件,我决定尝试一下 Alertify。我访问了网页: http: //fabien-d.github.io/alertify.js/

它告诉我使用 bower 包管理进行安装。他们甚至为我们提供了代码。我想知道的是在哪里写这段代码:

$ bower install alertify

我应该把它写在 html 文件、css 文件还是 jquery 文件中。

4

2 回答 2

4

为什么不直接使用该站点上编写的“插入 HTML”方法?

包含 JS

<!-- ideally at the bottom of the page -->
<!-- also works in the <head> -->
<script src="PATH_TO_FILE/alertify.min.js"></script>

包括 CSS

<!-- include the core styles -->
<link rel="stylesheet" href="PATH_TO_FILE/alertify.css" />
<!-- include a theme, can be included into the core instead of 2 separate files -->
<link rel="stylesheet" href="PATH_TO_FILE/alertify.default.css" />

如果你想使用 Bower,你应该使用 node.js。您可以在其github 页面中找到有关 Bower 的信息。

于 2013-07-30T11:47:17.463 回答
0

要回答您的问题,请将其输入命令行。Bower 是一个包管理器,从命令行运行,需要 Node 和 npm。如果您刚刚开始使用 jQuery 插件,我认为下载插件并将其包含到您的项目中会更容易。

于 2014-10-08T23:35:29.133 回答