Question to $(object).live('click', function)
Question to $(object).live('click', function)
Hi,
I have a question to correct usage of live() method. To catch a click event on image in table row I use the following code, which works fine for me.
[code]
$('.dataTable tbody td img').live('click', function (event) {
var v = event.target;
[/code]
Now I try to use the front-end frameworks bootstrap and font-awesome and display images in table rows by using the following syntax:
[code]
"fnRender": function (oObj) {
return ''
[/code]
Instead of the frameworks uses to show images. To catch the onclick event, I try
[code]
$('.dataTable tbody td i').live('click', function (event) {
var v = event.target;
[/code]
but this didn't work. Any idea?
Thanks in advanced
Arne
I have a question to correct usage of live() method. To catch a click event on image in table row I use the following code, which works fine for me.
[code]
$('.dataTable tbody td img').live('click', function (event) {
var v = event.target;
[/code]
Now I try to use the front-end frameworks bootstrap and font-awesome and display images in table rows by using the following syntax:
[code]
"fnRender": function (oObj) {
return ''
[/code]
Instead of the frameworks uses to show images. To catch the onclick event, I try
[code]
$('.dataTable tbody td i').live('click', function (event) {
var v = event.target;
[/code]
but this didn't work. Any idea?
Thanks in advanced
Arne
This discussion has been closed.
Replies
[code]
$('.dataTable tbody').on('click', 'td i', function () {... } );
[/code]
should do it. If it doesn't please link to a test page showing the problem.
Allan
works perfectly, many thanks.
Arne