第1715行的jQuery语法错误

时间:2014-01-14 17:40:52

标签: jquery twitter-bootstrap

我正在开发一个程序,我将jQuery的版本更新为2.0.3(1.7.2上的同样问题),现在我在控制台中看到错误:

Uncaught Error: Syntax error, unrecognized expression: http://172.16.191.166/system/administrator jquery-2.0.3.js:1715
ot.error jquery-2.0.3.js:1715
gt jquery-2.0.3.js:2325
kt jquery-2.0.3.js:2712
ot jquery-2.0.3.js:1154
x.fn.extend.find jquery-2.0.3.js:5158
x.fn.x.init jquery-2.0.3.js:168
x jquery-2.0.3.js:63
i bootstrap.min.js:6
(anonymous function) bootstrap.min.js:6
x.extend.each jquery-2.0.3.js:590
x.fn.x.each jquery-2.0.3.js:237
r bootstrap.min.js:6
x.event.dispatch jquery-2.0.3.js:4676
y.handle jquery-2.0.3.js:4360

这是我的来源

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<script type='text/javascript' src='http://172.16.191.166/system/administrator/template/admin/js/jquery-2.0.3.min.js'></script>
<script type="text/javascript" src="http://172.16.191.166/system/administrator/template/admin/js/jquery-ui.min.js"></script>
<script type='text/javascript' src="http://172.16.191.166/system/administrator/template/admin/bootstrap/js/bootstrap.min.js"></script>
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
    <div class="container-fluid">
        <ul class="nav">
            <li class="dropdown">
                <a href="" data-target="http://172.16.191.166/system/administrator" class="dropdown-toggle" data-toggle="dropdown">System</a>
            </li>
            <li class="dropdown">
                <a href="" data-target="http://172.16.191.166/system/administrator" class="dropdown-toggle" data-toggle="dropdown">User</a>
            </li>
        </ul>
    </div>
</div>
</div>
</body>
</html>

我已经将上面的HTML修改为我需要的最小值仍然会导致问题。我使用jQuery 1.7.2和2.0.3,Bootstrap 2.3.2和3.0.3来实现它。我无法在谷歌上找到任何可以为我提供任何线索的线索。

由于

1 个答案:

答案 0 :(得分:0)

我会冒险猜测并且说Bootstrap没有正确地清理来自数据目标的选择器。由于您的属性包含每http://api.jquery.com/category/selectors/个特殊字符,因此需要对其进行清理。

粗略地看一眼Bootstrap的来源,似乎就是这种情况。我会向Bootstrap提交一个错误,看看他们是否同意,尽管他们可能会告诉你要逃避属性中的特殊字符。

相关问题