How to AJAX-ify something that is not <a>?
Notice: This thread is very old.
- karelb
- Member | 17
Hello,
simple newbie question,
I like how simple is to “ajaxify” <a href>
s with
<a n:href="signal!" class="ajax">
; however, now I want to
add on-click action for something that is not
<a>
. How do I do that easily?
For example, I want to add something like this to a <td>
element. <td n:href="signal!" class=ajax>
does not work.
Enclosing the <td>
with <a>
does not work
either.
What is the simpliest way to achieve this?
Last edited by karelb (2013-12-26 18:45)
- petr.pavel
- Member | 535
<td data-href="{plink signal!}" class="ajax">
$('td.ajax').on('click', function() {
var url = $(this).data('href');
// etc.
});