如何在另一个 javascript 文件中包含插件文件
how to include plugin files in another javascript file
我使用 html(...) 和 jquery 将部分代码发送到我的 HTML 页面。我在用 html(...) 发送的部分使用了 jquery 插件 (Tooltipsetrt http://iamceege.github.io/tooltipster/?)。
但我的插件在该部分不起作用。
我想我必须在我的 jquery 中包含 Tooltipster 的插件文件。这样对吗?如果是,我应该怎么做?
这是我在 jquery 文件中与 html 一起发送的部分:
$('.donate_test').html('<a class="question-mark tooltip" href="google.com" title="This is my link's tooltip message!">(?)</a>');
添加该标签后重新初始化您的工具提示插件。
$('.donate_test').html('<a class="question-mark tooltip" href="google.com" title="This is my link's tooltip message!">(?)</a>');
$('.tooltip').tooltipster();
您对 tooltipster() 的初始调用可能在您的 $(document).ready() 中,因此如果您添加一个需要工具提示的新元素,您将不得不再次调用该插件.
我使用 html(...) 和 jquery 将部分代码发送到我的 HTML 页面。我在用 html(...) 发送的部分使用了 jquery 插件 (Tooltipsetrt http://iamceege.github.io/tooltipster/?)。 但我的插件在该部分不起作用。 我想我必须在我的 jquery 中包含 Tooltipster 的插件文件。这样对吗?如果是,我应该怎么做?
这是我在 jquery 文件中与 html 一起发送的部分:
$('.donate_test').html('<a class="question-mark tooltip" href="google.com" title="This is my link's tooltip message!">(?)</a>');
添加该标签后重新初始化您的工具提示插件。
$('.donate_test').html('<a class="question-mark tooltip" href="google.com" title="This is my link's tooltip message!">(?)</a>');
$('.tooltip').tooltipster();
您对 tooltipster() 的初始调用可能在您的 $(document).ready() 中,因此如果您添加一个需要工具提示的新元素,您将不得不再次调用该插件.