[英]JQuery menu method on ul throws “0x800a01b6 - Microsoft JScript runtime error: Object doesn't support this property or method”
I have this weird problem. 我有这个奇怪的问题。 When I have the following code doe a JQuery menu in its own html file – it works as expected.
当我有以下代码时,可以在自己的html文件中创建一个JQuery菜单-它可以按预期工作。 However, if I put it in my Master page which is used in ASP .Net application, the line of code
但是,如果我将其放在ASP .Net应用程序中使用的母版页中,则该行代码
$("#testMenu").menu();
throws the exception: 引发异常:
0x800a01b6 - Microsoft JScript runtime error: Object doesn't support this property or method 0x800a01b6-Microsoft JScript运行时错误:对象不支持此属性或方法
I want to make clear that it is not a dumb copy and paste. 我想弄清楚,这不是傻瓜复制和粘贴。 matches in both files.
在两个文件中都匹配。 in the master page has more scripts and CSS links.
主页中的更多脚本和CSS链接。 But everything listed below exists in the master page.
但是下面列出的所有内容都存在于母版页中。
<html class="no-js" lang="en">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" charset="utf-8" />
<title>jQuery UI Menu</title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<script>
$(function () {
$("#testMenu").menu();
});
</script>
<style>
.ui-menu {
width: 150px;
}
</style>
</head>
<body>
<ul id="testMenu" class="ui-menu">
<li><a href="#">Item 1</a></li>
<li><a href="#">Item 2</a></li>
<li><a href="#">Item 3</a>
<ul>
<li><a href="#">Item 3-1</a></li>
<li><a href="#">Item 3-2</a></li>
<li><a href="#">Item 3-3</a>
<ul>
<li><a href="#">Item 3-3-1</a></li>
<li><a href="#">Item 3-3-2</a></li>
<li><a href="#">Item 3-3-3</a></li>
<li><a href="#">Item 3-3-4</a></li>
<li><a href="#">Item 3-3-5</a></li>
</ul>
</li>
<li><a href="#">Item 3-4</a></li>
<li><a href="#">Item 3-5</a></li>
</ul>
</li>
<li><a href="#">Item 4</a></li>
<li><a href="#">Item 5</a></li>
</ul>
</body>
</html>
Any ideas what may be the problem? 任何想法可能是什么问题? Thanks for your help.
谢谢你的帮助。
0x800a01b6 - JavaScript runtime error: Object doesn't support property or method 'appendTo' 0x800a01b6-JavaScript运行时错误:对象不支持属性或方法“ appendTo”
IE : add a document.ready
to ensure #testmenu
is not undefined or null IE:添加一个
document.ready
以确保#testmenu
不是未定义或为null
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.