IE、FF的JS兼容问题,麻烦大家帮我看看。。。。

[code="js"]




我的主页
<br> function load(){<br> var tab1 = document.getElementById(&quot;tab1&quot;);<br> var arr = [&quot;淘宝网1&quot;,&quot;淘宝网2&quot;,&quot;淘宝网3&quot;,&quot;淘宝网4&quot;,&quot;淘宝网5&quot;,&quot;淘宝网6&quot;,&quot;淘宝网7&quot;,&quot;淘宝网8&quot;,&quot;淘宝网9&quot;,&quot;淘宝网10&quot;,&quot;淘宝网11&quot;,&quot;淘宝网12&quot;,&quot;淘宝网13&quot;,&quot;淘宝网14&quot;];<br> var line = Math.round((arr.length+6-1)/6);<br> var item =0;<br> for(var j=0;j<line;j++)<br> {<br> var tr = document.createElement("tr");<br> var begin = (((j+1)-1)*6+1)-1 ;<br> var end = (j+1)*6>arr.length ? arr.length : (j+1)*6;<br> var carr = arr.slice(begin,end);<br> for(var i=0;i<carr.length;i++)<br> {<br> var a = document.createElement('a');<br> a.appendChild(document.createTextNode(arr[item]));<br> a.setAttribute("href","http://www.taobao.com");<br> a.setAttribute("target","_blank");<br> var td = document.createElement("td");<br> td.appendChild(a);<br> tr.appendChild(td);<br> item++;<br> }<br> tab1.appendChild(tr); <br> }<br> tab1.setAttribute("border","1");<br> } <br>


         </table>       
     <br/>


[/code]

FF下可以运行,IE7无反应。请大家帮我看看。谢谢

[b]加入个tbody就可以了,FF IE8都通过了。你试试IE7吧。[/b]
[code="html"]








[/code]

[quote]我加了没用噢。。。[/quote]

id 是在 tbody上的,你改了没?