我的頁面上有兩個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>{ <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 ="< /tr>"; <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")[idocument.getElementsByName("radioo")[idocument.getElementsByName("radioo")[idocument.getElementsByName("radioo")[idocument.getElementsByName("radioo")[idocument.getElementsByName("radioo")[idocument.getElementsByName("radioo")[idocument。 ].value; <BR>} <BR>} <BR>window.opener.document.getElementById("foreignUnitCountry").value = valu; <BR>window.close(); <BR>} <BR>} <BR></ script> <BR> <BR><body> 輸入名稱搜尋: 複製程式碼 程式碼如下: 選擇 區域碼 國別名稱 td> ${list[0] } ${list[1] }