1

我正在关注本教程https://www.youtube.com/watch?v=3mOs0VY_sIw

$(function() {
    $( "#navsort" ).sortable({
        update: function(event, ui) {
            var postData = $(this).sortable('serialize');
            console.log(postData);

            $.post('save.php'. {list: postData}, function(o) { // i stuck here giving error
                console.log(o);
            }, 'json');
        }
    });
});

我坚持$.post('save.php'. {list: postData}, function(o)并给出错误SyntaxError: missing name after . operator

请帮我解决这个问题。我是 jquery 的新手

4

2 回答 2

2

You have . after save.php replace it with ,

$.post('save.php', {list: postData}, function(o) { 
                console.log(o);
            }, 'json');
于 2013-04-17T19:29:44.810 回答
1

You need to place a "," after 'save.php' instead of a ".".

 $.post('save.php', {list: postData}, function(o) { // i stuck here giving error
                console.log(o);
            }, 'json');
于 2013-04-17T19:30:08.790 回答