我正在尝试使用之前正在运行的jQuery工具提示,但是我在控制台中收到以下行中的未捕获类型错误:
$("img[title]").tooltip();
代码:
<title></title>
<link href="Styles/MainMaster.css" rel="stylesheet" type="text/css" />
<script type='text/javascript' src='/js/jquery.js'></script>
<script type='text/javascript' src='/js/jquery.simplemodal.js'></script>
<script type='text/javascript' src="http://cdn.jquerytools.org/1.2.7/full/jquery.tools.min.js"></script>
<script src="/Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
$("img[title]").tooltip();
});
</script>
<link href="Styles/PopUpWindow.css" rel="stylesheet" type="text/css" />
<script src="/Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>
我可能做错了什么?
答案 0 :(得分:1)
问题在于您的脚本存在冲突。
你应该组织你的脚本:
<title></title>
<link href="Styles/MainMaster.css" rel="stylesheet" type="text/css" />
<script type='text/javascript' src='/js/jquery.js'></script>
<script type='text/javascript' src='/js/jquery.simplemodal.js'></script>
<script type='text/javascript' src="http://cdn.jquerytools.org/1.2.7/full/jquery.tools.min.js"></script>
<script type="text/javascript">
$(function () {
$("img[title]").tooltip();
});
</script>
<link href="Styles/PopUpWindow.css" rel="stylesheet" type="text/css" />
<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>