below JQuery code for showing and hiding content of my html page. when i click on show product link all names of product comes below and when click hide product link it hides products. it is working as expected but in IE6.0 when i click on hide product link it is hiding check box also but in mozilla it is as expected
$(document.ready(function()){
toggleNodes=function(node,action){
var $content=$('.node-content', node);
var $symbol=$('.node-label>a>.ui-symbol-green',node);
If ( var ($symbol.hasClass('ui-symbol-circle-minus') &&
(action==undefined||action=='hide')))
{
$symbol.removeClass('ui-symbol-circle-minus');
$symbol.addClass('ui-symbol-circle-plus');
$info.addClass('closed');
$content.hide();
}
else if($symbol.hasClass('ui-symbol-circle-plus')) &&
(action=='undefined'||action=='undefined')
$symbol.addClass('ui-symbol-circle-minus');
$symbol.removeClass('ui-symbol-circle-plus');
$info.removeClass('closed');
$content.show();
}
return false;
}
toggleAllNodes=function(tree,action){
$('.node',tree).each(function(node)){
toggleNOde(node,action);
});
}
$('.tree .nodelabel>a').click(function(event)){
toggleNode(event.currentTarget.parentNode.parentNode);
event.preventDefault();
return false;
});
});
return false;
Please suggest how to correct this bug.
you have to put
varbefore the function defining.. IE has problems with it!