不好意思刚才代码没有发完全window.onload = function()
{
var i = 1;
var text = "<table border='0' align='center' cellpadding='10' cellspacing='1' bgcolor='#133D88' id='upTableimage_" + i + "'   style='position:absolute;display:block;cursor:move;' ><form action='upload.php' method='post'  target='uploadPage' enctype='multipart/form-data' onsubmit=" + '"' +"return uploading('upLoadInfoimage_"  + i + "')"  + '"' + " ><tr><td align='center' bgcolor='#8EA8EA'><table border='0' align='center' cellpadding='4' cellspacing='1' bgcolor='#B0C2F0'><tr><td bgcolor='#8EA8EA' class='whitefont' style='color:#0A246A'>选择文件</td><td bgcolor='#8EA8EA'>&nbsp;<input type='hidden' name='inputImagName' value='image_" + i +"' ><input type='hidden' name='haveName' id='haveNameimage_" + i  + "' value='' ><input type='hidden' name='delImage' id='delImageimage_"  + i + "' value='' > <input type='file' name='file'><input type='submit' name='Submit' value=' 上 传 '><input type='button' name='Submit3' id='delimage_" + i + "'value=' 删 除 ' onClick=" + '"' + "delUpLoadImg(this,'image_" + i + "')" + '"' + " disabled><input type='button' name='Submit3' value=' 关 闭 ' onClick='uploadHidden(this)'></td></tr><tr><td colspan='2' bgcolor='#8EA8EA'>&nbsp;缩略图宽度:<input type='text'  size='5' value='" + 100 + "' name='newWidth'>px 高度:<input type='text' size='5' value='" + 100 + "' name='newHeight'>px </td></tr><tr><td colspan='2' align='center' bgcolor='#ffffff'><span id='upLoadInfoimage_" + i + "'  style='color:red'></span></td></tr></table></td></tr></form></table>"; document.getElementById("aaa").innerHTML= text;
}
[code=HTML]
<div id="aaa" style="border:1px solid"></div>[/code]

解决方案 »

  1.   

    不好意思我第一次发的代码就是全的,是因为text 变量中的内容没有换行,我看着代码少,以为没有发完呢/大家就看第一次发的代码好了
      

  2.   

    IE和firefox的接受参数顺序是不一样的
    你把<table border='0' align='center' cellpadding='10' cellspacing.......等布局参数都去去掉一个一个加上测试下。因为两个浏览器可能接受顺序不一样
      

  3.   

    是表格嵌套的问题吧 把外围表格去掉就OK了 外层表格和form表单有冲突 具体自己检查
      

  4.   

    document.getElementById("aaa").innerHTML= text;innerHTML好像是IE的专用属性吧。
      

  5.   

    把 form弄到表格外表来就显示了
      

  6.   

    将Form放在Table的外面。
    注意良好的代码书写习惯。
    以下代码IE7和FF2.0下测试通过:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>无标题文档</title>
    </head><body>
    <script language="javascript">
    window.onload = function()
    {
    var i = 1;
    var text = "<form action='upload.php' method='post' target='uploadPage' enctype='multipart/form-data' onsubmit=" + '"' +"return uploading('upLoadInfoimage_"  + i + "')"  + '"' + " >"
    + "<table border='0' align='center' cellpadding='10' cellspacing='1' bgcolor='#133D88' id='upTableimage_" + i + "'   style='position:absolute;display:block;cursor:move;' >"
    + "<tr><td align='center' bgcolor='#8EA8EA'>"
    + "<table border='0' align='center' cellpadding='4' cellspacing='1' bgcolor='#B0C2F0'>"
    + "<tr><td bgcolor='#8EA8EA' class='whitefont' style='color:#0A246A'>选择文件</td>"
    + "<td bgcolor='#8EA8EA'>&nbsp;"
    + "<input type='hidden' name='inputImagName' value='image_" + i +"' >"
    + "<input type='hidden' name='haveName' id='haveNameimage_" + i  + "' value='' >"
    + "<input type='hidden' name='delImage' id='delImageimage_"  + i + "' value='' > "
    + "<input type='file' name='file'><input type='submit' name='Submit' value=' 上 传 '>"
    + "<input type='button' name='Submit3' id='delimage_" + i + "'value=' 删 除 ' onClick=" + '"' + "delUpLoadImg(this,'image_" + i + "')" + '"' + " disabled>"
    + "<input type='button' name='Submit3' value=' 关 闭 ' onClick='uploadHidden(this)'></td></tr>"
    + "<tr><td colspan='2' bgcolor='#8EA8EA'>&nbsp;"
    + "缩略图宽度:<input type='text'  size='5' value='" + 100 + "' name='newWidth'>px "
    + "高度:<input type='text' size='5' value='" + 100 + "' name='newHeight'>px </td></tr>"
    + "<tr><td colspan='2' align='center' bgcolor='#ffffff'><span id='upLoadInfoimage_" + i + "'  style='color:red'></span>"
    + "</td></tr></table></td></tr></table></form>";
    document.getElementById("aaa").innerHTML= text;
    }
    </script>
    <div id="aaa" style="border:1px solid"></div>
    </body>
    </html>
      

  7.   

    但有一个问题
    如果直接贴代码是能显示的
    为什么用innerHTML就不显示了呢
      

  8.   


    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta content="text/html; charset=gb2312" http-equiv="Content-Type"/>
    <title>无标题文档</title>
    </head>
    <body>
    <script language="javascript">
    </script>
    <div id="aaa" style="border: 1px solid ;">
    <table id="upTableimage_1" cellspacing="1" cellpadding="10" border="0" bgcolor="#133d88" align="center" style="position: absolute; display: block; cursor: move;">
    <form onsubmit="return uploading('upLoadInfoimage_1')" enctype="multipart/form-data" target="uploadPage" method="post" action="upload.php">
    <tbody>
    <tr>
    <td bgcolor="#8ea8ea" align="center">
    <table cellspacing="1" cellpadding="4" border="0" bgcolor="#b0c2f0" align="center">
    <tbody>
    <tr>
    <td class="whitefont" bgcolor="#8ea8ea" style="color: rgb(10, 36, 106);">选择文件</td>
    <td bgcolor="#8ea8ea">
    <input type="hidden" value="image_1" name="inputImagName"/>
    <input id="haveNameimage_1" type="hidden" value="" name="haveName"/>
    <input id="delImageimage_1" type="hidden" value="" name="delImage"/>
    <input type="file" name="file"/>
    <input type="submit" value=" 上 传 " name="Submit"/>
    <input id="delimage_1" type="button" disabled="" onclick="delUpLoadImg(this,'image_1')" value=" 删 除 " name="Submit3"/>
    <input type="button" onclick="uploadHidden(this)" value=" 关 闭 " name="Submit3"/>
    </td>
    </tr>
    <tr>
    <td bgcolor="#8ea8ea" colspan="2">
     缩略图宽度:
    <input type="text" name="newWidth" value="100" size="5"/>
    px 高度:
    <input type="text" name="newHeight" value="100" size="5"/>
    px
    </td>
    </tr>
    <tr>
    <td bgcolor="#ffffff" align="center" colspan="2">
    <span id="upLoadInfoimage_1" style="color: red;"/>
    </td>
    </tr>
    </tbody>
    </table>
    </td>
    </tr>
    </tbody>
    </form>
    </table>
    </div>
    </body>
    </html></body>
    </html>这是firebug上取的生成的html
      

  9.   

    难道FF 不支持 innnerHTML?