Response.write输出Js换行问题,在线等结贴送分
我的代码内容如下,问题出现在response.Write语句中,最终生成的静态代码3个变量的赋值是在一行输出的,没有换行所以无法运行,手工换行后代码运行正常:
<script type="text/javascript">
<!--
var focus_width=256
var focus_height=196
var text_height=21
var swf_height = focus_height+text_height
<%
response.Write(" var pics='http://img1.qq.com/finance/20051122/2703144.jpg|http://img1.qq.com/finance/20051122/2703015.jpg|http://img1.qq.com/finance/20051122/2703290.jpg|http://img1.qq.com/finance/20051122/2703455.jpg'")
response.Write(" var links='http://finance.qq.com/a/20051122/000192.htm|http://finance.qq.com/a/20051122/000282.htm|http://finance.qq.com/a/20051122/000312.htm|http://finance.qq.com/a/20051122/000318.htm|http://www.flashsky.cn/play.asp?flashid=2177'")
response.Write(" var texts='首批580个煤矿被吊销生产许可证|方便面“拒绝油炸”引发行业众怒|国外造币机构抢占“神六”商机|天天“过节”能拯救百货商场吗?' ")
%>
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 +'" height="'+ swf_height +'">');
document.write('<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="http://finance.qq.com/flash/focus.swf"> <param name="quality" value="high"><param name="bgcolor" value="#CCCCCC">');
document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
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="flash/focus.swf" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu="false" bgcolor="#ffffff" quality="high" width="'+ focus_width +'" height="'+ swf_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'); document.write('</object>');
//-->
</script>