Can anyone tell me why this would generate a syntax error in Safari and not in Firefox?
toggle = function(){
$("#type_new").hide();
$("a[class^='toggle']").unbind('click').click(function(){
$.class = $(this).attr("class");
if($(":input."+$.class+".text").is(':visible')==true) $(this).find("small").html("Add New Type"); else $(this).find("small").html("Choose From Exisiting Types");
$(":input."+$.class+".select").toggle();
$(":input."+$.class+".text").toggle().val("");
});
};
The error comes here:
$.class = $(this).attr("class");
Any simplification is welcome as well. This works just fine in firefox. Also you might ask why it's so complicated but sometimes I'll have more than one of these on a page so I need the function to know which one to handle.
Thanks.