views:

33

answers:

1

Return a erron in http://www.neguzelhaber.com/ on sidebar in tab content with firebug. The error is "subcontent is null" I try different ways for solve this problem but I can't understand this error's cause. I suppose the problem is caused by wp-recentcomments plugin. I think so that because I check this script with wp-recentcomments' old version I didn't come up any problem with...

+1  A: 

The problem is that the code assumes that all of the element id values in an array will correspond to actual elements on the page. It can be changed:

expandsubcontent:function(subcontentid){
  for (var i=0; i<this.subcontentids.length; i++){
    var subcontent=document.getElementById(this.subcontentids[i]) //cache current subcontent obj (in for loop)
    if (subcontent)
      subcontent.style.display=(subcontent.id==subcontentid)? "block" : "none" //"show" or hide sub content based on matching id attr value
  }
}, 
Pointy
this is true solution. thank you.
Aaron
sorry it is not working, this is not true solution.
Aaron
Well I can't help you if you don't describe how it is not working. That was definitely a problem, but there may be others. If you do not say how it is not working, you will get no help.
Pointy