1、IE中不兼容Ajax中data最后一个参数加逗号,其余Chrome Firefox均支持。
code:
1 $("document ").ready(function() { 2 $(".btn_fbpl").click(function() { 3 var num = $(".comment_num").text(); 4 var name = $("#user_name").text(); 5 var u_img = $("#user_head").html(); 6 var user_img = u_img.replace('small', 'big'); 7 var comment = $(".txt_srk").val(); 8 if(comment=='') { 9 alert('评论不能为空。');10 }else{11 if(name){12 $.ajax({13 type: "POST",14 url: "../do_comment.html",15 data: {16 detail_id:"{$detail_id}",17 username:name,18 user_img:user_img,19 comment:comment //ie中加逗号会报错!!!20 },21 success: function(datas) {22 var dat = jQuery.parseJSON(datas);23 if (dat.ture == '1') {24 $(".addit").PRepend('<li>' + user_img + '<dl><dt> <a href =/"#/">' + name + '<//a> <span> 发表于 ' + dat.now+ ' <//span> <//dt> <dd><span>' + comment + '<//span><//dd> <//dl> <//li>');25 var num_a = parseInt(num) + 1;26 $(".txt_srk").val("");27 $(".comment_num").html(num_a);28 }29 }30 });31 }else{32 alert('请注册登录,发表自己的评论');33 }34 } 35 36 });37 });
2、
新闻热点
疑难解答