我发出了Ajax请求,并且成功以JSON格式显示,我希望它显示在表格中,并且在每个表格的前面都具有单选按钮,以便它将运费显示在表格的底部,但是问题是表格是在显示表格,还是在表格底部未显示运费?
$.ajax(ajaxurl,{
type: 'GET',
data: { action: 'getImageProduct',value: kukui,value2: barang,},
dataType: "json",
success: function(data){
var txtHint = document.getElementById('txtHint');
var meja = '<table border="1"><thead><tr><th>Radio</th><th>Shipping Name</th><th>Shipping Fee</th><th>Shipping Time</th></tr></thead><tbody>';
$("input[type='radio']").click(function(){
var radioValue = $("input[name='choose']:checked").val();
if(radioValue){
$('#radioresult').val($("[type='radio']:checked").val());
}
});
$.each(data.msg, function(index, value){
//console.log(index);
meja += '<tr>';
meja += '<td><input type="radio" name="choose" value="'+value.shipping_fee+'"></td>';
meja += '<td>'+value.shipping_name+'</td>';
meja += '<td>'+value.shipping_fee+'</td>';
meja += '<td>'+value.shipping_time+'</td>';
meja += '</tr>';
});
meja += '</tbody></table>';
txtHint.innerHTML = meja;
//$("#txtHint").append(event_data);
},
无线电值在表格底部什么也不显示
答案 0 :(得分:0)