请将
<script language=JavaScript>
var focus_width = 227;
var focus_height = 172;
var text_height = 20;
var swf_height = focus_height + text_height;
   var pics='/UpFile/20081231165718.jpg|/UpFile/2008123075657.jpg|/UpFile/20081223101326.jpg|/UpFile/2008122210409.jpg';
 var links='/news_show.asp?id=1769|/news_show.asp?id=1758|/news_show.asp?id=1742|/news_show.asp?id=1741';
 var texts='局团委举办第...|我局隆重举行...|我局举行纪念...|我局隆重召开...';
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ focus_width +'px" height="'+ swf_height +'px">');
   document.write('<param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="upfile/topview.swf" /><param name="quality" value="high" />');
   document.write('<param name="menu" value="false"><param name="wmode" value="transparent" />');
   document.write('<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" />');
   document.write('<embed src="upfile/topview.swf" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu="false" quality="high" width="'+ focus_width +'px" height="'+ focus_height +'px" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
   document.write('</object>');
//  -->
</script>
转换为
StringBuilder sb = new StringBuilder();
            sb.AppendLine("<script language=JavaScript>");
这种方式,我在处理引号时,给处理错了.现在都不知道怎么写引号了.请各位帮忙.谢谢

解决方案 »

  1.   

    赞同楼上说的,你可以把语句截断,或是用转义符document.write(' <param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" />'); 
    比如这段代码,你可以这样写:  document.write(" <param name=\"FlashVars\" value=\"pics=\'"+pics+"\'&links=\'"+links+"\'&texts='\"+texts+"\'&borderwidth=\'"+focus_width+"\'&borderheight=\'"+focus_height+"\'&textheight=\'"+text_height+"\'/>"); (没有试,可能会有错,但是我平时用时都是用'\'去处理的,你不妨试下)