jQuery意外令牌,在哪里?

I can't get this short hello-world-like ajax function work for hours.

Uncaught SyntaxError: Unexpected token : is all the error message.

<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
    $('td').click(function(){
        $.ajax(function(){
            type: 'POST',
            url: 'admin_ajax.php',
            data: {change_rights:8},
            success: function(msg){
                alert(msg);
            }
        });
    });
});
</script>

Remove function() from Ajax request

$.ajax({
//-----^-
    type:   'POST',
    url:    'admin_ajax.php',
    data:   {change_rights:8},
    success: function(msg){
        alert(msg);
    }
});

Documentation : https://api.jquery.com/jQuery.ajax/

change the code like this

 $(document).ready(function(){
    $('td').click(function(){

        $.ajax({
        type:   'POST',
        url:    'admin_ajax.php',
        data:   {change_rights:8},
        success: function(msg){
            alert(msg);
        }
    });
    });
});