当前位置: 代码迷 >> Ajax >> 为什么这段jquery代码会提示异常Microsoft JScript 运行时异常: 对象不支持此属性或方法
  详细解决方案

为什么这段jquery代码会提示异常Microsoft JScript 运行时异常: 对象不支持此属性或方法

热度:901   发布时间:2012-02-05 12:07:15.0
为什么这段jquery代码会提示错误Microsoft JScript 运行时错误: 对象不支持此属性或方法 - Web 开发 / Ajax
错误出现在$("#example").accordion();
网上下载的例子,原例子运行没问题,我用VS 2008另建了个网站,代码全部COPY自原例子,
结果却出现了以上错误。。。请指教

index.htm代码:
HTML code

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
                    "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title>Jquery-q2</title>
    <script type="text/javascript" src="jquery-latest.js"></script>
    <link rel="stylesheet" href="flora.all.css" type="text/css" media="screen" title="Flora (Default)" />
    <script type="text/javascript" src="ui.accordion.js"></script>
    <script type="text/javascript" src="ui.core.js"></script>
    <script type="text/javascript">
      $(document).ready(function(){
      $("#example").accordion();
      });
    </script>
</head>
<body>
<ul id="example" class="ui-accordion-container" style="width: 200px;">
        <li>
            <a href='#'>Test 1</a>
            <div>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
            </div>

        </li>
        <li>
            <a href='#'>Test 2</a>
            <div>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam <br>
            </div>
        </li>
        <li>
            <a href='#'>Test 3</a>
            <div>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
            </div>
        </li>
    </ul>
</body>
</html>







------解决方案--------------------
引入的js文件路径 有没有写对?
------解决方案--------------------
<script type="text/javascript" src="ui.accordion.js"></script>
<script type="text/javascript" src="ui.core.js"></script>
顺序换一下看看。
  相关解决方案