Javascript issue on ie

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • amitabh joshi
    New Member
    • Jul 2011
    • 1

    Javascript issue on ie

    Code:
    Varien.Tabs = Class.create();
    Varien.Tabs.prototype = {
      initialize: function(selector) {
        var self=this;
        $$(selector+' a').each(this.initTab.bind(this));
      },
    
      initTab: function(el) {
          el.href = 'javascript:void(0)';
          if ($(el.parentNode).hasClassName('active')) {
            this.showContent(el);
          }
          el.observe('click', this.showContent.bind(this, el));
      },
    
      showContent: function(a) {
        var li = $(a.parentNode), ul = $(li.parentNode);
        ul.select('li', 'ol').each(function(el){
          var contents = $(el.id+'_contents');
          if (el==li) {
            el.addClassName('active');
            contents.show();
          } else {
            el.removeClassName('active');
            contents.hide();
          }
        });
      }
    }
    new Varien.Tabs('.tabs');


    I am facing problem. I have written above code.



    In FireFox and IE8 it works but in IE6-7 it gives me following error.

    parent node is null
    Last edited by Dormilich; Jul 11 '11, 01:31 PM.
Working...