问题
I'm trying to use the code below, but it's not working: UPDATED WORKING:
$(document).ready(function() { 
    $('.infor').click(function () {
     var datasend = $(this).html();
        $.ajax({
            type: 'POST',
            url: 'http://domain.com/page.php',
            data: 'im_id='+datasend',
            success: function(data){
                $('#test_holder').html(data);
            }
            });
    }); 
});
As you can see I used $datasend as the var to send but it doesn't return the value of it, only its name.
回答1:
I would change
    $datasend = $(this).html;
to
    var datasend = $(this).html();
Next I would change
    data: 'im_id=$datasend',
to
    data: 'im_id='+datasend,
来源:https://stackoverflow.com/questions/8023275/data-variable-in-jquery-ajax-function