Jump to content

[SOLVED] Syntax Error - I just cannot see it.


Perad

Recommended Posts

Hey, I am having a bit of trouble with the code below. It works in Firefox but not in Safari / IE. If I alert the class it works fine. However, somewhere in assigning a variable I am getting an error. Any ideas?

 

       $('tr').click ( function () {

     // get this class name
     alert($(this).attr('class'));
     var class = $(this).attr('class'); // Error is on this line.
     
     $.post("http://localhost/example/ajax/read", {id: class}, function() {

     });
     
     // now toggle the tr element matching this class if there is one
     $('.content-' + class).toggle();
     $('.'+class + ' td').css('font-weight', 'normal');

});

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.