_outhtml是哪儿的?
_tabletemp.outerHTML本来的值是你的
("<table cellSpacing=0 borderColorDard=#ffffff cellPadding=0 borderColorLight=#000000 border=1>")
为什么又重新赋值?

解决方案 »

  1.   

    function f()
    {
    var str='<table><tr><td>hello,world</td></tr></table>'
    alert(g(str).outerHTML);
    }
    function g(aa)
    {
    var x=document.createElement('div');
    x.innerHTML=aa;
    return x.all(0);
    }
      

  2.   

    _tabletemp.outerHTML=_outhtml   应该是
    _tabletemp.outerHTML=a
      

  3.   

    a="<table cellSpacing=0 borderColorDard=#ffffff cellPadding=0 borderColorLight=#000000 border=1><tbody><tr><td>合计:</td><td colSpan=4>5555</td><td>¥sum{5}</td><td>单价</td><td>¥sum{5}</td></tr></tbody></table>"var bbouterHTML =  Product(a)function Product(a)
    {
    return document.createElement(a)
    }
      

  4.   

    _tabletemp.outerHTML=_outhtml   
    document.appendChild(_tabletemp)=====>
    document.appendChild(_tabletemp)
    _tabletemp.outerHTML=aappendChild之后更改outerHTML才有效

    var bbouterHTML =  Product(a)获得新创建的table对象的引用,该引用的outerHTML是appendChild之前设定的的table相关内容
      

  5.   

    修改document.appendChild(_tabletemp)
    _tabletemp.outerHTML=a
    也没友吧a增加到节点...郁闷
      

  6.   

    document.appendChild(_tabletemp);=======>document.body.appendChild(_tabletemp);
      

  7.   

    function Product(a)
    {
    return document.createElement(a)
    }后返回的<table>....</table>
    变成了<<table>....</table>>...