gpt4 book ai didi

jquery - 如何使用标签管理器?

转载 作者:行者123 更新时间:2023-12-01 03:44:24 26 4
gpt4 key购买 nike

谁能告诉我这个标签管理器的简单实现,使其在简单的 html 文件上工作?

http://welldonethings.com/tags/manager

我确实尝试自己实现它,如下所示,但我无法让它工作。

<html>
<head>
<title>tags example</title>
<script type="text/javascript" src="assets/js/bootstrap-tagmanager.js"></script>
<script type="text/javascript" src="assets/css/bootstrap-tagmanager.css"></script>
<script src="assets/js/jquery-1.9.0.min.js" type="text/javascript"></script>
</head>
<body>

<input type="text" name="tags" placeholder="Tags" class="tagsManager"/>

<script src="assets/js/angular/angular.min.js"></script>
<script src="assets/js/angular/angular-resource.min.js"></script>
<script src="assets/js/app.js"></script>
<script src="assets/js/controllers.js"></script>
<script src="assets/js/jquery-ui-1.10.0.custom.min.js" type="text/javascript"> </script>
<script src="assets/js/bootstrap.min.js" type="text/javascript"></script>

<script type="text/javascript">
jQuery(".tagManager").tagsManager({
prefilled: ["Pisa", "Rome"],
CapitalizeFirstLetter: true,
preventSubmitOnEnter: true,
typeahead: true,
typeaheadAjaxSource: null,
typeaheadSource: ["Pisa", "Rome", "Milan", "Florence", "New York", "Paris", "Berlin", "London", "Madrid"],
delimeters: [44, 188, 13],
backspace: [8],
blinkBGColor_1: '#FFFF9C',
blinkBGColor_2: '#CDE69C',
hiddenTagListName: 'hiddenTagListA'
});
</script>

</body>
</html>

最佳答案

检查这个FIDDLE出来,你还没有添加隐藏字段hiddenTagListA

从此更改您的代码

 <script type="text/javascript" src="assets/js/bootstrap-tagmanager.js"></script>
<script type="text/javascript" src="assets/css/bootstrap-tagmanager.css"></script>
<script src="assets/js/jquery-1.9.0.min.js" type="text/javascript"></script>

<script type="text/javascript">
jQuery(".tagManager").tagsManager({
prefilled: ["Pisa", "Rome"],
CapitalizeFirstLetter: true,
preventSubmitOnEnter: true,
typeahead: true,
typeaheadAjaxSource: null,
typeaheadSource: ["Pisa", "Rome", "Milan", "Florence", "New York", "Paris", "Berlin", "London", "Madrid"],
delimeters: [44, 188, 13],
backspace: [8],
blinkBGColor_1: '#FFFF9C',
blinkBGColor_2: '#CDE69C',
hiddenTagListName: 'hiddenTagListA'
});
</script>

到此

 <link href="assets/css/bootstrap-tagmanager.css" rel="stylesheet" type="text/css" />
<script src="assets/js/jquery-1.9.0.min.js" type="text/javascript"></script>
<script type="text/javascript" src="assets/js/bootstrap-tagmanager.js"></script>

<script type="text/javascript">
$(function () {
$(".tagsManager").tagsManager({
prefilled: ["Pisa", "Rome"],
CapitalizeFirstLetter: true,
preventSubmitOnEnter: true,
typeahead: true,
typeaheadAjaxSource: null,
typeaheadSource: ["Pisa", "Rome", "Milan", "Florence", "New York", "Paris", "Berlin", "London", "Madrid"],
delimeters: [44, 188, 13],
backspace: [8],
blinkBGColor_1: '#FFFF9C',
blinkBGColor_2: '#CDE69C',
hiddenTagListName: 'hiddenTagListA'
});
});
</script>

关于jquery - 如何使用标签管理器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15171314/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com