Click here to Skip to main content
15,885,216 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
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
// 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.
Posted
Updated 21-Mar-14 3:20am
v2
Comments
Maarten Kools 21-Mar-14 8:50am    
I assume toggler is some kind of jQuery plugin? Are you including the scripts? Your code doesn't show that.
Sampath Lokuge 21-Mar-14 8:52am    
Where's the code for this : "div.collapse" ? Please put that also.
[no name] 21-Mar-14 9:02am    
The 'div.collapse' is in a separate file: expand.js (see it below). Thanks for your review.
$.fn.toggler.defaults = {
cllpsEl : 'div.collapse',
method : 'slideToggle',
speed : 'slow',
container : '', //the common container of all groups with collapsible content (optional)
initShow : '.shown' //the initially expanded sections (optional)
};
[no name] 21-Mar-14 9:10am    
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!

1 solution

Member 10417613 Says:
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!

Conclusion :

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

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900