未捕获的类型错误:对象 [对象对象] 没有方法“弹出”

Posted

技术标签:

【中文标题】未捕获的类型错误:对象 [对象对象] 没有方法“弹出”【英文标题】:Uncaught TypeError: Object [object Object] has no method 'popup' 【发布时间】:2014-05-12 14:38:40 【问题描述】:

我一直在尝试使用 $('#partsPopup').popup("close"); 关闭 jquery 弹出窗口但它给了我没有方法弹出错误。这是我遵循的脚本顺序。请帮我。谢谢

<link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.css" />
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script>
<link rel="stylesheet" type="text/css" href="css/jquery.mobile-1.3.2.min.css"  />
<link rel="stylesheet" type="text/css" href="css/index.css"  />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js">  </script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js"></script>

【问题讨论】:

为什么要加载jquery两次? 【参考方案1】:

你只需要包含一次jQuery,尝试在此处删除版本1.10.2

<link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.css" />
<link rel="stylesheet" type="text/css" href="css/jquery.mobile-1.3.2.min.css"  />
<link rel="stylesheet" type="text/css" href="css/index.css"  />
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js"></script>

【讨论】:

以上是关于未捕获的类型错误:对象 [对象对象] 没有方法“弹出”的主要内容,如果未能解决你的问题,请参考以下文章

未捕获的类型错误对象没有方法'insertafter' [重复]

未捕获的类型错误:对象 [object Object] 没有方法“Jcrop”

未捕获的类型错误:对象 #<Object> 没有方法“movingBoxes”

未捕获的错误:不变违规:元素类型无效:对象

vuejs 3:未捕获的类型错误:对象(...)不是函数[重复]

DOJO 工具提示给出“未捕获的类型错误:对象不是函数”