gpt4 book ai didi

javascript - ReferenceError:未定义 Taggle

转载 作者:行者123 更新时间:2023-11-28 19:39:52 26 4
gpt4 key购买 nike

在包含所有必要的库后,我不明白为什么我在 Firebug 控制台中收到此错误?

我的 HTML 代码如下:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<link rel="stylesheet" href="formoid_files/formoid1/formoid-default-skyblue.css" type="text/css" />
<link href="http://localhost/smart/web/css/bootstrap.min.css" rel="stylesheet">
<link href="http://localhost/smart/web/css/bootstrap-responsive.min.css" rel="stylesheet">
<link href="http://fonts.googleapis.com/css?family=Open+Sans:400italic,600italic,400,600" rel="stylesheet">
<link href="http://localhost/smart/web/css/font-awesome.min.css" rel="stylesheet">
<link href="http://localhost/smart/web/css/ui-lightness/jquery-ui-1.10.0.custom.min.css" rel="stylesheet">
<link href="http://localhost/smart/web/css/base-admin-3.css" rel="stylesheet">
<link href="http://localhost/smart/web/css/base-admin-3-responsive.css" rel="stylesheet">
<link href="http://localhost/smart/web/css/pages/plans.css" rel="stylesheet">
<link href="http://localhost/smart/web/css/custom.css" rel="stylesheet">
<link href="http://localhost/smart/web/css/bootstrap-multiselect.css" rel="stylesheet">
<link href="http://localhost/smart/web/css/prettify.css" rel="stylesheet">
<link href="http://localhost/smart/web/css/datepicker.css" rel="stylesheet">
<link href="http://localhost/smart/web/css/projects.min.css" rel="stylesheet">
<link href="http://localhost/smart/web/css/taggle.min.css" rel="stylesheet">
<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<style type="text/css">
.account-container1 {
width: 505px;
display: block;
margin: 60px auto 0 auto;
background: #f9f9f9;
border: 1px solid #d5d5d5;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
.account-container1 h1 {
margin-bottom: 0.4em;
color: #F90;
font-size: 32px;
}
</style>
<div class="main">
<div class="account-container1 stacked">
<div class="content clearfix">
<form action="contact_us.php" id="contact_us_form" role="form" class="form-horizontal col-md-12" method="post">
<h1>Admin Settings</h1>
<fieldset>
<div class="form-group">
<label for="email" class="col-lg-2">Email :<span style="color:#FF0000">*</span></label>
<div class="col-lg-10">
<div class="input textarea clearfix custom stackoverflow"></div>
</div>
</div>
<div align="center" class="login-actions">
<input type="submit" style="float:right" class="login-action btn btn-primary" name='submit' value="Send">
</div> <!-- .actions -->
</fieldset>
</form>
</div> <!-- /content -->
</div> <!-- /account-container -->
</div>
<!-- Le javascript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="http://localhost/smart/web/js/libs/jquery-1.9.1.min.js"></script>
<script src="http://localhost/smart/web/js/libs/jquery-ui-1.10.0.custom.min.js"></script>
<script src="http://localhost/smart/web/js/custom/jquery-1.10.1.js"></script>
<script src="http://localhost/smart/web/js/custom/jquery-ui.js"></script>
<script src="http://localhost/smart/web/js/libs/bootstrap.min.js"></script>
<script src="http://localhost/smart/web/js/plugins/validate/jquery.validate.js"></script>
<script src="http://localhost/smart/web/js/Application.js"></script>
<script src="http://localhost/smart/web/js/demo/validation.js"></script>
<script src="http://localhost/smart/web/js/bootstrap-multiselect.js"></script>
<script src="http://localhost/smart/web/js/prettify.js"></script>
<script src="http://localhost/smart/web/js/custom/common.js"></script>
<script src="http://localhost/smart/web/js/bootstrap-datepicker.js"></script>
<script src="http://localhost/smart/web/js/custom/typeahead.js"></script>
<script src="http://localhost/smart/web/js/custom/rainbow-custom.min.js"></script>
<script src="http://localhost/smart/web/js/custom/scripts.js"></script>
<script src="http://localhost/smart/web/js/custom/taggle.js"></script>
<script src="http://localhost/smart/web/js/custom/taggle-ie8.js"></script>
<script src="http://localhost/smart/web/js/custom/taggle-ie9.js"></script>
<script language="javascript"></script>
</body>
</html>

文件 script.js 中的 jQuery 代码如下:

/*global Taggle*/
(function() {
new Taggle($('.stackoverflow.textarea')[0], {
tags: ['or', 'like', 'stackoverflow']
});
}());

当我尝试向具有类堆栈溢出的文本区域添加标签时,我在 Firebug 控制台中收到以下错误:

ReferenceError: Taggle is not defined     new Taggle($('.stackoverflow.textarea')[0], {

最佳答案

您正在加载script.js 加载前 taggle.js ,这意味着您正在尝试使用尚 undefined object 。

尝试移动<script src="http://localhost/smart/web/js/custom/scripts.js"></script>另一条线 <script...行。

关于javascript - ReferenceError:未定义 Taggle,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25302103/

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