换个提法就是在javascript函数中怎样使用html语言?

解决方案 »

  1.   

    没明白你的意思
    document.write("<iframe height='340' width='546' src='select.htm' scrolling='no' frameborder='0'></iframe>");
    这段代码是正确的
      

  2.   

    没错呀,你把frameborder去掉就看见效果了
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <script language="javascript">
    function  goopen()
    {
    document.write("<iframe height='340' width='546' src='select.htm' scrolling='no' ></iframe>");
    }
    </script>
    </head>
    <body onload="javascript:goopen()">
    </body>
    </html> 
      

  3.   

    我希望<iframe>打开得页面是在一个单元格里的,而不是整个文档就打开一个'select.htm' 页面。<html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312"></head>
    <body>
    <table width="75%" border="1">
      <tr>
        <td align="center" bgcolor="#B9BDC6"><font color="#000000">测试表格</font></td>
      </tr>
      <tr>
        <td height="50">我希望&lt;iframe&gt;在下面的单元格中打开一个新页面!</td>
      </tr>
      <tr>
        <td height="219"><script language="javascript">
    function  goopen()
    {
    document.write("<iframe height='340' width='546' src='select.htm' scrolling='no' ></iframe>");
    }
    </script></td>
      </tr>
    </table>
    </body>
    </html> 
      

  4.   

    不能用write参考:
    <script>
    function goopen()
    {document.all.f.innerHTML="<iframe height='340' width='546' src='select.htm' scrolling='no' frameborder='0'></iframe>";}
    </script>
    <table ><tr><td id=f>sdfsdf</td></tr></table>
    <input type=button value="Go" onclick="goopen()">
      

  5.   

    多谢 baiyunfei,试试再来结贴!