我的页面上有两个table,调用ajax之后隐藏掉一个,然后用html拼出另一个table,结果新的table最上面有个undefined,这个是怎么引起的,要怎么解决下呢?详细代码如下: 复制代码 代码如下: <BR>$(function(){ <BR>if($.browser.msie) <BR>{ <BR>$("#country").get(0).attachEvent("onpropertychange",function (o){ <BR>var countr = o.srcElement.value; <BR>$("#tabb1").hide(); <BR>$.ajax({ <BR>type: "post", <BR>url: "/yoblhtjfx/queryCountryAjax.action", <BR>data: "country="+countr+"&jsoncallback=?", <BR>dataType: "json", <BR>success: function(json) <BR>{ <BR>var tableHTML; <BR>tableHTML+="<table id='tabb1' border='1' width='100%'>"; <BR>tableHTML+="<tr>"; <BR>tableHTML+="<td style='text-align: center' >选择"; <BR>tableHTML+="<td style='text-align: center' >区域码"; <BR>tableHTML+="<td style='text-align: center' >国别名称"; <BR>tableHTML+=""; <BR>var list = json.list; <BR>for(var i=0;i<list.length;i++) <BR>{ <BR>tableHTML+="<tr>"; <BR>tableHTML+="<td style='text-align: center'><input type='radio' name='radioo' value='"+list[i][1]+"' />"; <BR>tableHTML+="<td style='text-align: center'>"+list[i][0]+""; <BR>tableHTML+="<td style='text-align: center'>"+list[i][1]+""; <BR>tableHTML+=""; <BR>} <BR>tableHTML+=""; <BR>$("#querycountrydiv").html(tableHTML); <BR>} <BR>}); <BR>}); <BR>} <BR>}); <BR>function returnVal() <BR>{ <BR>var valu; <BR>for(var i = 0;i < document.getElementsByName("radioo").length;i++) <BR>{ <BR>if(document.getElementsByName("radioo")[i].checked == true) <BR>{ <BR>valu = document.getElementsByName("radioo")[i].value; <BR>} <BR>} <BR>window.opener.document.getElementById("foreignUnitCountry").value = valu; <BR>window.close(); <BR>} <BR> 输入名称搜索: 复制代码 代码如下: 选择 区域码 国别名称 ${list[0] } ${list[1] }