javascript - 未捕获的类型错误 : Object [object Object] has no method 'wipetouch'

标签 javascript jquery

我正在尝试将wipetouch插件集成到我的产品组合中http://www.i-jp.nl ,目前还没有成功。

Chrome 给出以下错误:

Uncaught TypeError: Object [object Object] has no method 'wipetouch'

我无法找出问题所在。这是调用wipetouch的代码,位于slider.js中:

$(document).wipetouch({
                wipeLeft: function(result) { 
                    //if (slide >= 0 && slide < 3){
                        //$(".slider").animate({"right": "+=320px"}, "slow");
                        //slide = slide + 1;
                    //};
                    alert('test');
                },
            });

最佳答案

您的 jQuery 加载了两次。这导致 wipetouch 方法不可用的问题。

至于修复。我会尝试删除代码中的第二个 jQuery 文件引用

以下是 Felix Kling 提供的更多信息:

The problem is that you are loading two different jQuery versions, 1.8.0 and 1.7.2. The plugin attaches to jQuery.fn which is the 1.7.2 version, not $. Is see that the later included version (1.7.2) calls jQuery.noConflict();, which reverts the $ to point to the earlier included version.

您首先在第 11 行加载 jQuery:

<script src="http://code.jquery.com/jquery-latest.js"></script>

然后在第 18 行再次:

<script type='text/javascript' src='http://i-jp.nl/wp-includes/js/jquery/jquery.js?ver=1.7.2'></script>

关于javascript - 未捕获的类型错误 : Object [object Object] has no method 'wipetouch' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11901131/

相关文章:

jquery - 如何以编程方式构造对象数组

javascript - asp :XmlDataSource Expected DTD markup was not found. 第 1 行,位置 3

javascript - 带有固定内容 block 的侧边栏固定面板

javascript - 找不到模块 'lodash'

javascript - 一种形式多种产品

javascript - 如何禁用滚动(溢出 :hidden) 除外

php - 如何从 Codeigniter Controller 中分离 Ajax 响应中的 View 和数据

javascript - 如何将计数时间更改为 unix 时间戳?

基于另一个 div 样式的 JavaScript 样式 div [帮助]

javascript - 重新加载部分页面后,JQuery .on() 绑定(bind)不起作用