0

私は次のコードを持っています

$(".momentoCommentArea").on('keypress',function(event) {
    console.log(event.which); //mypublicpost.js:42
    if (event.keyCode == 13) { //enterkey //mypublicpost.js:43
        var message = $(".momentoCommentArea").val(); //mypublicpost.js:44
        //mypublicpost.js:44
        $.post('momento/newComment',  //mypublicpost.js:46
                    {'picaid':currentFid,'msg':message},
                    function(data){
                var tComment=$("<div></div>").addClass('momento-comment');
                var imgUrl=$("#siddlb-comments").children(".momento-comment").children('.momento-comment-img').children('img').attr('src');
                $("<div></div>").addClass('momento-comment-img').html('<img src="'+imgUrl+'" width="40" height="40" />').appendTo(tComment);
                $("<div></div>").addClass('momento-comment-comment').html("<b>"+$("#membername").html()+"</b><br/>"+message).appendTo(tComment);
                $("<div></div>").addClass('momento-comment-date').html('This seccion').appendTo(tComment);
                $("#momento-comments > div.momento-comment:first").before(tComment);
        });
    }
});

コードを実行すると(textareaにテキストを入力してEnterキーを押す)、次のエラーが発生します。

Uncaught TypeError: Illegal invocation jquery-1.7.2.js:7740
  jQuery.extend.param.add jquery-1.7.2.js:7740
  buildParams jquery-1.7.2.js:7797
  buildParams jquery-1.7.2.js:7792
  buildParams jquery-1.7.2.js:7792
  buildParams jquery-1.7.2.js:7792
  buildParams jquery-1.7.2.js:7792
  buildParams jquery-1.7.2.js:7792
  buildParams jquery-1.7.2.js:7792
  jQuery.extend.param jquery-1.7.2.js:7760
  jQuery.extend.ajax jquery-1.7.2.js:7606
  jQuery.each.jQuery.(anonymous function) jquery-1.7.2.js:7245
  (anonymous function) mypublicpost.js:45  //EDIT: line 45 is $.post line
  jQuery.event.dispatch jquery-1.7.2.js:3332
  jQuery.event.add.elemData.handle.eventHandle

誰かがそのエラーの意味と、そのエラーを修正するためにどのようにアプローチすべきかを提案できますか?

編集

Chromeの開発ツールのスクリーンショット

ここに画像の説明を入力してください

4

1 に答える 1

1

上記のコメントからの要約:

これは、JSONデータに提供された不正な変数の単純なケースのようです...かなり広範囲のエラーメッセージが表示されます。

于 2012-09-27T15:00:12.713 に答える