在Firefox和Chrome中正常工作时,网格无法在Internet Explorer中运行

时间:2014-02-17 05:43:27

标签: javascript internet-explorer

网格无法在Internet Explorer中运行,而它在Firefox和Google Chrome中运行良好。我认为java脚本中存在一些错误。只显示网格顶行而第二行没有追加这是我的代码

function contractor_details(data)
{
for(var i=0;i<data.length;i++){
        var contrator_table = document.getElementById('contractor_detail');
        var cname = data[i].contractor;
        var address = data[i].address;
}
    $('#enlistmentData').html('');
    if(data.length==1){
        $('#enlistmentData').html('<input type="hidden" name="contname" id="enlistmentinput" value= "'+data[0].contractor+'" />');
    }else{
    $('#enlistmentData').append('<table border="1" style="width:100%" id="enlistmentData_table"><tr><td></td><td><font size=3>Company Name</font></td><td><font size=3>Address</font></td></tr></table>');
$.each(data,function(k,val){
    $('#enlistmentData_table').append('<tr><td align=left><input type="radio" name="contname" value="'+val.contractor+'"></td><td>'+val.contractor+'</td><td>'+val.address+'</td></tr></table>');
        });
    }

}

0 个答案:

没有答案