Monday, 15 April 2013

uncaught syntaxerror unexpected identifier at jquery ajax url -



uncaught syntaxerror unexpected identifier at jquery ajax url -

i have ajax code this

$.ajax({     url: "ajax_post_url",     type: "post",     data: {commentid:commentid,commenttext:commenttext}, datatype : 'json'     success: function(data)     {         if(data.error=='false'){ $('comment'+commentid).html(commenttext); }     }, });

i facing error "uncaught syntaxerror unexpected identifier" @ url line.

please help

thanks in advance

i pointed out syntax error made comment lines

try,

$.ajax({ url: "ajax_post_url", type: "post", data: { commentid: commentid, commenttext: commenttext }, datatype: 'json', //missed comma on here success: function (data) { if (data.error == 'false') { $('comment' + commentid).html(commenttext); } } //placed unncessary comma on here });

jquery ajax

No comments:

Post a Comment