douwen5985 2019-08-19 14:31
浏览 153

我的代码通常在本地WAMP SERVER服务器上,但它不运行任何Web服务器

function addRow() {
    $("#addRowBtn").button("loading");

    var tableLength = $("#productTable tbody tr").length;

    var tableRow;
    var arrayNumber;
    var count;

    if(tableLength > 0) {
        tableRow = $("#productTable tbody tr:last").attr('id');
        arrayNumber = $("#productTable tbody tr:last").attr('class');
        count = tableRow.substring(3);
        count = Number(count) + 1;
        arrayNumber = Number(arrayNumber) + 1;                  
    } else {
        // no table row
        count = 1;
        arrayNumber = 0;
    }

    $.ajax({
        url: 'php_action/fetchProductData.php',
        type: 'post',
        dataType: 'json',
        success:function(response) {
            $("#addRowBtn").button("reset");            

            var tr = '<tr id="row'+count+'" class="'+arrayNumber+'">'+                          
                '<td>'+
                    '<div class="form-group">'+

                    '<select class="form-control" name="productName[]" id="productName'+count+'" onchange="getProductData('+count+')" >'+
                        '<option value="">~~SELECT~~</option>';
                        // console.log(response);
                        $.each(response, function(index, value) {
                            tr += '<option value="'+value[0]+'">'+value[1]+'</option>';                         
                        });

                    tr += '</select>'+
                    '</div>'+
                '</td>'+
                '<td style="padding-left:20px;"">'+
                    '<input type="text" name="rate[]" id="rate'+count+'" autocomplete="off" disabled="true" class="form-control" />'+
                    '<input type="hidden" name="rateValue[]" id="rateValue'+count+'" autocomplete="off" class="form-control" />'+
                '</td style="padding-left:20px;">'+
                '<td style="padding-left:20px;">'+
                    '<div class="form-group">'+
                    '<input type="number" name="quantity[]" id="quantity'+count+'" onkeyup="getTotal('+count+')" autocomplete="off" class="form-control" min="1" />'+
                    '</div>'+
                '</td>'+
                '<td style="padding-left:20px;">'+
                    '<input type="text" name="total[]" id="total'+count+'" autocomplete="off" class="form-control" disabled="true" />'+
                    '<input type="hidden" name="totalValue[]" id="totalValue'+count+'" autocomplete="off" class="form-control" />'+
                '</td>'+
                '<td>'+
                    '<button class="btn btn-default removeProductRowBtn" type="button" onclick="removeProductRow('+count+')"><i class="glyphicon glyphicon-trash"></i></button>'+
                '</td>'+
            '</tr>';
            if(tableLength > 0) {                           
                $("#productTable tbody tr:last").after(tr);
            } else {
                $("#productTable tbody").append(tr);
            }       

        } // /success
    }); // get the product data

} // /add row

How to proceed in this case? Is there an error?

I get error:

Failed to load resource: the server responded with a status of 500

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
    • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
    • ¥20 有关区间dp的问题求解
    • ¥15 多电路系统共用电源的串扰问题
    • ¥15 slam rangenet++配置
    • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
    • ¥15 ubuntu子系统密码忘记
    • ¥15 保护模式-系统加载-段寄存器
    • ¥15 电脑桌面设定一个区域禁止鼠标操作
    • ¥15 求NPF226060磁芯的详细资料