日期:2014-05-16  浏览次数:20333 次

我想在生成js时实现这样的特殊效果
生成js时我想把
Content   =   Content   &   "document.write( '· <a   href= "&Rs( "FilePath ")&Rs

( "FileName ")& "   target=_blank> <font  

color=red> "&Title& " </font> </a> <br> ') "&vbCrLf
这样的效果改成分两列来显示新闻标题和日期,且新闻标题为红色,我写成下面代码:
      Content=Content   &   "document.write( ' <table   width=100%   border=0   cellspacing=0   cellpadding=0> "&vbCrLf
            Content=Content   &   "document.write( ' <tr   style= 'height:25px '> <td   width= '85% '> · <a   href= "&Rs( "FilePath ")&Rs( "FileName ")& "   target=_blank> <font   color=red> "&Rs( "title ")& " </font> </a> </td> "&vbCrLf
    Content=Content   &   "document.write( ' <td   width= '15% '> <font   color=#999999> "&year(Rs( "addtime "))& "- "&month(Rs( "addtime "))& "- "&day(Rs( "addtime "))& " </font> "&vbCrLf
    Content=Content   &   "document.write( ' </td> </tr> "&vbCrLf
    Content=Content   &   "document.write( ' <tr> <td   bgcolor= '#EAEAEA '   colspan= '2 '   height= '1 '> </td> </tr> "&vbCrLf
            Content=Content   &   "document.write( ' </table> "
但是就没有生成js文件了,问题在什么地方?


------解决方案--------------------
Content=Content & "document.write( " " <table width=100% border=0 cellspacing=0 cellpadding=0> "
Content=Content & " <tr style= 'height:25px '> <td width= '85% '> · <a href= "&Rs( "FilePath ")&Rs( "FileName ")& " target=_blank> <font color=red> "&Rs( "title ")& " </font> </a> </td> "
Content=Content & " <td width=15%> <font color=#999999> "&year(Rs( "addtime "))& "- "&month(Rs( "addtime "))& "- "&day(Rs( "addtime "))& " </font> "
Content=Content & " </td> </tr> "
Content=Content & " <tr> <td bgcolor=#EAEAEA colspan=2 height=1> </td> </tr> "
Content=Content & " </table> " "); "&vbCrLf

不好意思,中间的&vbCrLf不能要。也就是document.write()中的内容不能换行。