TypeError:$(…)。tooltip不是函数

我有一个由jquery填充的gridview。 以下是我的代码的一部分,它给出了上述错误:

var codes = $(this).find("Code").text(); $("td", row).eq(6).html($(this).find("oTotal").text()); if ($(this).find("Stock").text() == 'Y') { $("td", row).eq(7).html('Y'); $('#' + codes).live('click', function () { $('#' + codes).tooltip(); }); } else { $("td", row).eq(7).html($(this).find("Stock").text()); } 

我在$(’#’+代码)上遇到错误.tooltip(); 我有jquery.ui / 1.8.22和jquery / 1.8.3。

我认为工具提示不是您正在提取的文件的一部分。您是否能够将您的CDN参考更新为jQuery UI:

http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js

我通过移动上面的所有Javascript标记解决了这个问题:

 < jdoc:include type="head" /> 

希望它也适合你。

tooltip()不是函数!!!

我通过在角度4中使用以下步骤解决了这个问题。

使用npm install jquery命令npm install jquery

在路径src / typings.d.ts文件中添加以下代码。

 declare var jquery:any; interface jquery { tooltip(options?:any):any; } 

它解决了tooltip()问题。

tooltip是Bootstrap的一部分,因此包括bootstrap应解决问题。

使用bootstrap检查的快速链接,您可以从引导链接的开头删除https: :。