这样可以吗?
<p><td height="67">bbbbb<script src="cc.js"></script></td></p>
为什么会换行我不知道
等高手来解答

解决方案 »

  1.   

    执行顺序问题,先执行了bb.js,执行完后执行 cc.js.因此,执行cc.js的时候 表格已经画好了,再写东西自然就写在后面了。
    把bb.js改成:
    document.write('<table width="760" border="1" cellspacing="0" cellpadding="0">');
    document.write('  <tr>');
    document.write('    <td height="67" id="lfecnu">bbbbb<script src="cc.js"></script></td>');
    document.write('  </tr>');
    document.write('</table>');
    cc.js改成:
    document.all.lfecnu.innerText=document.all.lfecnu.innerText+"ccc";
      

  2.   

    to sugarshop(糖果店) 
    我试过了,不行,但是也谢谢你的回答。to  lfecnu() 
    你说的方法成功了。呵呵,谢谢。你能解释一下document.all.lfecnu.innerText这行语句的意思吗?尤其是all是什么意思?还有,帮忙看看这个帖子 http://community.csdn.net/Expert/topic/3767/3767042.xml
      

  3.   

    document.all.elementId 表示:返回页面上id为elementId的对象
      

  4.   

    为什么是document.all.elementId 而不是document.elementId 呢
      

  5.   

    你问的问题,就像为什么1+1=2一样,赫赫。也可以这么用。document.all[elementId]。
      

  6.   

    还有,如果cc.js文件是别人已经事先写好的,那么还有解决办法吗?
      

  7.   

    to Croatia(Croatia)
    什么时候用all,什么时候不用?这个能解释吗?我看到有时候没有用all
      

  8.   

    all是一collection,后面可以跟点来引用其内部成员,但document就不是了
      

  9.   

    document是一对象,即DHTML中的Object,其成员由Attributes、Properties、Methods、Events、Collections和Behaviors等组成,像
    document.BODY就是document的Attribute(特性);
    document.bgColor就是document的property(属性);
    all就是document可以引用的collectioin(集合)之一,类似的collection还有forms(页面上所有表单form的集合)、images(页面上所有图片的集合)等
      

  10.   

    document.write('<table width="760" border="1" cellspacing="0" cellpadding="0">');
    document.write('  <tr>');
    document.write('    <td height="67" id="lfecnu" nowrap>bbbbb<script src="cc.js"></script></td>');
    document.write('  </tr>');
    document.write('</table>');
    应该可以解决了.
      

  11.   

    to xjdawu(左右互搏)
    谢谢你的解释,你能推荐类似你解释的内容的资料吗?to  goocity(健)
    如果把cc.js文件中的内容改成document.all.lfecnu.innerText=document.all.lfecnu.innerText+"ccc";会正常,但是如果cc.js文件不更改有没有解决办法?
      

  12.   

    我那的TD属性加了nowrap,应该不会换行的呀.
      

  13.   

    不行啊,如果cc.js文件中这么写document.write('ccccccccccccccccc'); 那么改成你的代码也不行,非得改一下cc.js文件。但是,cc.js文件如果是别人的,我无法修改,难道就没有了办法了吗?
      

  14.   

    试试用iframe控制:
    bb.js改成:
    document.write('<table width="760" border="1" cellspacing="0" cellpadding="0">');
    document.write('  <tr>');
    document.write('    <td height="67" id="lfecnu">bbbbb<iframe src="ee.htm" frameborder=0 height=15 scrolling="no" frameborder=0 marginwidth=0 marginheight=0></iframe></td>');
    document.write('  </tr>');
    document.write('</table>');cc.js不动
    增加一个页面:ee.htm
    <html>
    <script src=cc.js></script>
    </html>