small code work in all browser but IE, particularly IE8

small code work in all browser but IE, particularly IE8

  1. jQuery.fn.hoverToggleClass = function(class){
  2.     return this.live('mouseover mouseout',function(e){
  3.         if(e.type=='mouseover'){
  4.             $(this).addClass(class);
  5.         }else{
  6.             $(this).removeClass(class);
  7.         }
  8.     });
  9. }

The code is too simple to cause a problem i think, but in IE8 it says "expected identifier". I have no idea what it wants.