Click here to Skip to main content
15,893,486 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
I have a div that I populate with a table. The actual code for the table is create from a webservice and then loaded into the div using Ajax. I then have a function that looks like this:

JavaScript
$('.myTableRowClass').live('click', function() {
     alert('I was clicked');
});


This works fine in Firefox and Chrome, but does not seem to work in IE. I cant seem to figure out why.

Thanks in advance,
-Dom
Posted

There are a lot of JS/Jquery complaints against IE9 and IMO, there's nothing much we can do about it. However, I found this[^] post, that claims that jQuery 1.5.1 supports IE9. Might want to consider upgrading your version jQuery that you are using.
 
Share this answer
 
Comments
DominicZA 20-Apr-12 3:54am    
Awesome, thanks, but I am using 1.6.1 already. I have ended up writing a little work around for IE that will do for now!
why don't you try simple click function instead of live as:
HTML
$('#xxx').click(function () {
....
});
 
Share this answer
 
.live is deprecated in jQuery 1.7.1 and in the documentation,it was suggested to use .on() in place of .live,

can u try like this

$('.myTableRowClass').on('click', function() {
     alert('I was clicked');
});
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900