1. 程式人生 > >js 替換html

js 替換html

-c ima -name str dal error: data guid ont

function getInfo(){
            var player_name=$("#name").val();
            $.ajax({
                url: get_wefare,
                method: POST,
                dataType: json,
                data: {name:player_name},
                success: function(res) {
                   // console.log
(res); if(res.code==0){ var tr_td = ‘‘; tr_td+="<td>"+res.content.PlayerID+"</td><td>"+res.content.NickName; tr_td+="</td><td>"+res.content.se+"</td><td>"+res.content.ceer; tr_td
+="</td><td>"+res.content.Level+"</td>"; tr_td+=<td><input type="text" class="form-control" id="buy_num" value=""/></td><td><button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">發放</button></td>
; $("#my_tr").html(tr_td); }else{ toastr.error(res.msg); } }, error:function(res){ toastr.error(res.msg); } }); }

js 替換html