jQuery 移动引用错误 "a is undefined"

标签 jquery jquery-mobile

我在 header 中引用以下 jquery 文件:

<link rel='stylesheet' href='$root/css/jquery.mobile-1.3.2.min.css'>

<script type='text/javascript' src='$root/js/jquery.mobile-1.3.2.min.js'>
</script>

<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js'>
</script>

我收到以下错误:

a is undefined

该错误引用了整个 jquery.mobile-1.3.2.min.js 文件。

有什么想法为什么会发生这种情况吗?

最佳答案

脚本的顺序错误。同时关闭link标记。

jQuery mobile 以 jQuery 命名。

这是CDN 托管的文件

<link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.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' href='$root/css/jquery.mobile-1.3.2.min.css'/>
<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js'>
</script>
<script type='text/javascript' src='$root/js/jquery.mobile-1.3.2.min.js'>
</script>

关于jQuery 移动引用错误 "a is undefined",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18371952/

相关文章:

javascript - 允许子元素的触摸移动

javascript - 使用 Ember.$.ajax() 发送具有关系的数据

javascript - 反转最后索引

javascript - Jquery Droppable 克隆,但不删除

jQuery UI 自动完成 - 输入与结果集不匹配时不显示结果

javascript - jQuery 移动 : selecting by ID doesn't work well

javascript - 在 jQuery(Internet Explorer?)中缓存元素

javascript - Netbeans IDE 的 JQuery-Mobile 代码辅助(代码(自动)完成、代码提示)

javascript - 表单提交上的 JQuery 自定义函数 - 不起作用

jquery - 使用自定义宽高,jQuery Mobile Dialog center to screen