为什么我下面这句无法显示?
Response.Write "document.getElementById('weather').innerHTML ='<table width=""100%""  border=""0""><tr><th width=27>日期</th><th width=28>天气现象</th><th width=15>气温</th><th width=15>风向</th><th width=15>风力</th></tr></table>';"

解决方案 »

  1.   

    DHTML 手册 如是说:The property is read/write for all objects except the following, for which it is read-only: COL, COLGROUP, FRAMESET, HTML, STYLE, TABLE, TBODY, TFOOT, THEAD, TITLE, TR. The property has no default value
      

  2.   

    Response.Write "document.getElementById('weather').innerHTML ='<table width=\""100%\"" border=\""0\""><tr><th width=27>日期</th><th width=28>天气现象</th><th width=15>气温</th><th width=15>风向</th><th width=15>风力</th></tr></table>';"
      

  3.   

    不知道你的完整代码以及错误提示是什么,所以无法给出更多建议。
    以下代码是可以正常执行的:<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
    <!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>
    <span id="weather"></span>
    <script language="javascript">
    <%
    Response.Write "document.getElementById('weather').innerHTML ='<table width=\""100%\"" border=\""0\""><tr><th width=27>日期</th><th width=28>天气现象</th><th width=15>气温</th><th width=15>风向</th><th width=15>风力</th></tr></table>';"
    %>
    </script>
    </body>
    </html>
      

  4.   

    加上  转义 字符  \Response.Write "document.getElementById('weather').innerHTML ='<table width=""100%"" border=""0"">
    <tr>
    <th width=27>日期<\/th>
    <th width=28>天气现象<\/th>
    <th width=15>气温<\/th>
    <th width=15>风向<\/th>
    <th width=15>风力<\/th>
    <\/tr>
    <\/table>';"
      

  5.   

    这个结果是传递到另一个页面的,楼上的我都试过,还是无法显示,用div可以显示,就是加了table就不能显示了。不知怎么回事。
      

  6.   

    在这个写出的字符串前加 @  TRY一下!!
      

  7.   

    table里面的属性不加引号也是可以的