JavaScript错误:对象不支持此属性或方法 [英] JavaScript error: Object doesn't support this property or method

查看:375
本文介绍了JavaScript错误:对象不支持此属性或方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于ASP.net项目中的页面,我部署在IIS 6和IIS 7.5服务器中。它适用于II6服务器中的那个,但是对于IIS 7.5服务器,我收到了JavaScript错误:对象不支持此属性或方法。该错误发生在JS代码中。相关代码如下:

For a page in an ASP.net project, I deployed in both IIS 6 and IIS 7.5 servers. It is fine for the one in II6 Server, but for the IIS 7.5 server I received JavaScript error: Object doesn't support this property or method. The error occurs at the JS code. The related code is below:

// HTML code
<h3 class="expand">GIS Web Services and GIS Web Services</h3>

// JS Code
$(function () {
    $("h3.expand").toggler({ initShow: "div.collapse:first"}); // error here
    ...   }

// Related stylesheet code
.expand a {
  display:block;
  padding:3px 10px
}
.expand a:link, .expand a:visited {
  border-width:1px;
  background-image:url(../Images/collapse.png);
  background-repeat:no-repeat;
  background-position:98% 50%;
}
.expand a:hover, .expand a:active, .expand a:focus {
  text-decoration:underline
}
.expand a.open:link, .expand a.open:visited {
  border-style:solid;
  background:#eee url(../Images/expand.png) no-repeat 98% 50%
}



后果是展开/折叠功能根本不起作用,并且不显示展开/折叠图标。

感谢您能否提供问题的提示。


The consequence is that the Expand/Collapse functions don't work at all and the Expand/Collapse icons don't display.
Appreciate if you can provide me the hint for the problem.

推荐答案

(function(){
(function () {


(h3.expand)。toggler({initShow:div.collapse:first}); //这里错误
...}

//相关样式表代码
.expand a {
display:block;
padding:3px 10px
}
.expand a:link,.expand a:visited {
border-width:1px;
background-image:url(../ Images / collapse.png);
background-repeat:no-repeat;
background-position:98%50% ;
}
.expand a:hover,.expand a:active,.expand a:focus {
text-decoration:underline
}
.expand a。 open:link,.expand a.open:visited {
border-style:solid;
background:#eee url(../ Images / expand.png)no-repeat 98%50%
}
("h3.expand").toggler({ initShow: "div.collapse:first"}); // error here ... } // Related stylesheet code .expand a { display:block; padding:3px 10px } .expand a:link, .expand a:visited { border-width:1px; background-image:url(../Images/collapse.png); background-repeat:no-repeat; background-position:98% 50%; } .expand a:hover, .expand a:active, .expand a:focus { text-decoration:underline } .expand a.open:link, .expand a.open:visited { border-style:solid; background:#eee url(../Images/expand.png) no-repeat 98% 50% }



结果是扩展/折叠功能根本不起作用,并且不显示展开/折叠图标。

如果你能提供给我,请感谢int为问题。


The consequence is that the Expand/Collapse functions don't work at all and the Expand/Collapse icons don't display.
Appreciate if you can provide me the hint for the problem.


成员10417613说:
Member 10417613 Says:

亲爱的Sampath:我发现问题是因为我使用IIS 7.5的项目没有expand.js。你的提示帮助我解决了这个问题。请重新发布您的评论然后我可以归功于您的工作并使线程关闭。非常感谢!

Dear Sampath: I found the problem was because in my project that uses the IIS 7.5 did not have th expand.js. Your hint helped me solve the problem. Please re-post your comment and then I can credit your work and make the thread closed. Thanks very much!



结论:



您应该添加展开。 js 进入你的项目,也需要正确引用它。


Conclusion :

You should add the expand.js into your project and is needed to properly reference that too.


这篇关于JavaScript错误:对象不支持此属性或方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆