当前位置: 代码迷 >> ASP >> 来帮忙下!关于ASP生成JS然后在HTML里调用的有关问题
  详细解决方案

来帮忙下!关于ASP生成JS然后在HTML里调用的有关问题

热度:117   发布时间:2012-03-21 13:33:15.0
高手进来帮忙下!关于ASP生成JS然后在HTML里调用的问题!
<%
response.write   " <script   type=text/javascript> "
response.write   "var   focus_width   =   250 "
response.write   "var   focus_width   =   250 "
response.write   "var   focus_height   =   210 "
response.write   "var   text_height   =   20 "
response.write   "var   swf_height   =   focus_height+text_height "   '图的格式如下,XX.jpg|xx1.jpg...
response.write   "var   pics= 'http://192.168.1.101/image/77gamer.jpg|http://192.168.1.101/image/cg2.jpg ' "
response.write   "var   links= 'http://192.168.1.101/index.html|http://192.168.1.101/index.html ' "
response.write   "var   texts= '祝贺网站成立!|XXXX频道开通! ' "
response.write   "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   + '> '); "
response.write   "document.write( ' <param   name=allowScriptAccess   value=sameDomain> <param   name=movie   value=http://192.168.1.101/pixviewer.swf> <param   name=quality   value=high> <param   name=bgcolor   value=#cccccc> '); "
response.write   "document.write( ' <param   name=allowScriptAccess   value=sameDomain> <param   name=movie   value=http://192.168.1.101/pixviewer.swf> <param   name=quality   value=high> <param   name=bgcolor   value=#cccccc> '); "
response.write   "document.write( ' <param   name=menu   value=false> <param   name=wmode   value=opaque> <param   name=wmode   value=transparent> '); "
response.write   "document.write( ' <param   name=FlashVars   value= " "pics= '+pics+ '&links= '+links+ '&texts= '+texts+ '&borderwidth= '+focus_width+ '&borderheight= '+focus_height+ '&textheight= '+text_height+ ' " "> '); "
response.write   "document.write( ' <embed   src=http://192.168.1.101/pixviewer.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   /> '); "
response.write   "document.write( ' </object> '); "
response.write   " </script> "
%>
这段代码我保存为news.asp
然后我在index.html里用
<script   type= "text/javascript "   src= "news.asp "> </script>
调用
但为什么没一点效果的啊?是那里出错了啊!请高手指点下

------解决方案--------------------
IE查看下源文件就知道了。
都改成:
response.write " <script type=text/javascript> "&chr(13)
response.write "var focus_width = 250; "&chr(13)
response.write "var focus_width = 250; "&chr(13)
response.write "var focus_height = 210; "&chr(13)
  相关解决方案