由于某些原因,jQuery UI手风琴无法工作。我一直在犯这个错误:
TypeError:$(.).accordion不是函数
我做错什么了?基于这个网站上关于类似主题的其他答案,我认为它与包含的文件有关。
我的标题包括:
<!-- Mobile Specific Metas -->
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<!-- CSS -->
<link rel="stylesheet" href="<?php echo base_url(); ?>css/base_con.css">
<link rel="stylesheet" href="<?php echo base_url(); ?>css/skeleton.css">
<link rel="stylesheet" href="<?php echo base_url(); ?>css/layout.css">
<!--[if lt IE 8]>
<script src="http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE8.js"></script>
<![endif]-->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<!-- Favicons -->
<link rel="shortcut icon" href="<?php echo base_url(); ?>images/favicon.ico">
<link rel="apple-touch-icon" href="<?php echo base_url(); ?>images/apple-touch-icon.png">
<link rel="apple-touch-icon" sizes="72x72" href="images/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="114x114" href="images/apple-touch-icon-114x114.png">
<link rel="stylesheet" href="<?php echo base_url(); ?>css/custom-theme/jquery-ui-1.10.0.custom.css" type="text/css" />
<!-- Scripts -->
<script src="<?php echo base_url(); ?>js/jquery-1.9.0.js"></script>
<script src="<?php echo base_url(); ?>js/jquery-ui-1.10.0.custom.js"></script>
<script src="<?php echo base_url(); ?>js/responsiveslides.min.js" type="text/javascript">发布于 2014-05-03 12:48:09
这个问题可能产生于几件不同的事情:
由于前两者不适用于您,我建议您重新检查路径,并使用完整的jQuery UI库,而不是自定义的库:
<script src="http://code.jquery.com/ui/1.10.0/jquery-ui.js"></script>发布于 2014-10-07 08:36:05
使用两个jquery.js文件可能导致冲突并导致抛出错误。避免导入两个或多个jquery.js文件。
发布于 2013-09-21 14:18:14
在最后的代码行中,按以下顺序包括脚本:-
没有必要包括以下内容,因为它将由上面的脚本照顾。
https://stackoverflow.com/questions/14898071
复制相似问题