Q:

how to get information from tag 's action-data?

I want to put some information in the "action-data" of a href, like:
 <a href=# action-data="userid={{g.user._id}}&amp;messageid={{message._id}}" id=reply >reply</a>

but how to get the userid & messageid back to Javascript code?
<script type=text/javascript>
$(function () {
    $('a#reply').bind('click', function () {
        $.getJSON($SCRIPT_ROOT + '/_get_replies', {
            messageid: ??????How to get messageid from href action-data?
            userid: ??????How to get userid from href action-data?
        }, function (data) {
        $('#replies').text(data.result)
        });
        return false;
    });
});

A:

store it differently:
<a href="#"data-userid="{{g.user._id}}" data-messageid="{{message._id}}" id="reply">reply</a>

jQuery can get it like this:
 var messageId = $('#reply').data('messageid');

Also, the click event can be much shorter:
$('a#reply').click(function(){

});

ps: remember to use quotes, as you didn't in href and id

