Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/81.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
向Drupal添加twitter搜索api的自定义jquery插件_Jquery_Drupal_Drupal 7 - Fatal编程技术网

向Drupal添加twitter搜索api的自定义jquery插件

向Drupal添加twitter搜索api的自定义jquery插件,jquery,drupal,drupal-7,Jquery,Drupal,Drupal 7,我正在尝试将这个jquery插件实现到Drupal中 我将以下js添加到我的theme.info和所需的css中 scripts[] = js/jquery.twitter.search.js scripts[] = js/jquery.twitterpopup.js 我用以下代码调用插件 (function($) { $('.article').find('.twitter_search').twitterpopup(); }(jQuery)); 我不确定插件不起作用是什么问题。我希望有人

我正在尝试将这个jquery插件实现到Drupal中

我将以下js添加到我的theme.info和所需的css中

scripts[] = js/jquery.twitter.search.js
scripts[] = js/jquery.twitterpopup.js
我用以下代码调用插件

(function($) {
$('.article').find('.twitter_search').twitterpopup();
}(jQuery));
我不确定插件不起作用是什么问题。我希望有人能引导我度过这一关

HTML


实验

您从哪里调用插件?i、 你的职能是在什么文件中

你确定你的JS确实在运行吗?尝试只做一个警报或控制台日志来检查是否发生了任何事情,或者使用Firebug或Chrome dev工具来添加断点

使用Drupal需要检查的一件事是,自从将脚本添加到theme.info文件后,您已经刷新了主题注册表

清除所有缓存,或访问主题设置页面。

尝试

(函数($){
$('.article').find('.twitter_search').twitterpopup();
})(jQuery)


您在
}(jQuery))
需要
}(jQuery)

页面中是否有
文章
类的元素?里面有
.twitter\u search
元素吗?或者用其他词:你能给我们看看你的html吗?添加了html,顺便说一句,我正在使用drupal 7。投票支持缓存清除提示。通常可以解决我的大部分奇怪问题。我将该函数放在一个名为jtweet.js的文件中,并将其添加到theme.info中。清除了我的缓存和所有的东西。我还编写了另外三个自定义jquery脚本,但它们工作得很好。我是不是调用该函数时出错了?所以如果你的函数只是说
alert('hello world')是否发生警报?如果你使用firebug等,你的脚本在页面上吗?控制台是否显示任何错误?
<div class="article">
    <span class="twitter_search">experiment</span>
</div>