Response.write输出Js换行问题,在线等结贴送分

skycuilin 2005-11-22 10:27:24
我的代码内容如下,问题出现在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>

...全文
515 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
skycuilin 2005-11-22
  • 打赏
  • 举报
回复
OK,解决问题,送分
gatey 2005-11-22
  • 打赏
  • 举报
回复
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'"&vbcrlf)
后面加个vbcrlf就可以了
skycuilin 2005-11-22
  • 打赏
  • 举报
回复
此段代码可以直接运行,出错后把生成的js变量换行输出能够运行

28,406

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧