一段js代码只针对Firefox和opera无效
时间:2010-05-31
来源:互联网
本人业余喜欢学点web技术,套用0k3w的新闻发布系统自做了一个网站,其中一段首页图片滚播的js代码,自动提取被设置为“图片滚播”的文章中图片,在除了opera和Firefox外的所有浏览器均能正常显示,唯独此二者只显示背景色。本人对js不太懂,头都大了就是搞不明白,请求高人指点。
在http://www.jrzgltzzs.cn中可以查看效果,IE、Safari、chrome可以正常显示,Firefox、opera不显示,为了不至于空白,本人在
<%Call Ok3w_Article_ImgFlash("",322,280)%>调用代码之后加了一段js代码,针对这两个浏览器输出另一个flash。
下面是这段图片滚播的js代码,请高人分析哪里出了问题,应该如何修改?上述网站是本人的第一个web,很业余很垃圾,恳求指点,呵呵
Private Sub Ok3w_Article_ImgFlash(ClassID,Width,Height)
Randomize
RndID = Int(Rnd()*10000)
RndFun = "__Ok3w_Article_ImgFlash__00" & RndID
Response.Write "<script type=""text/javascript"">"
Response.Write "function " & RndFun & "()"
Response.Write "{"
Sql="select top 5 Id,Title,PicFile,TitleColor,TitleURL from Ok3w_Article where ChannelID=1 and IsPass=1 and IsPlay=1 and IsDelete=0"
If ClassID<>"" Then Sql=Sql & " and SortPath like '%," & ClassID & ",%'"
Sql=Sql & " order by IsTop desc,IsCommend desc,Id desc"
Rs.Open Sql,Conn,0,1
pics = ""
links = ""
texts = ""
Do While Not Rs.Eof
ID = Rs("ID")
Title = Rs("Title")
PicFile = ReplaceUpFilePath(Rs("PicFile"))
TitleURL = Rs("TitleURL")
If TitleURL = "" Then TitleURL = Page_URL(ChannelID,"",ID)
pics = pics & PicFile & "|"
links = links & TitleURL & "|"
texts = texts & Title & "|"
Rs.MoveNext
Loop
Rs.Close
If texts<>"" Then
pics = Left(pics,Len(pics)-1)
links = Left(links,Len(links)-1)
texts = Left(texts,Len(texts)-1)
End If
Response.Write " var pics=""" & pics & """;"
Response.Write " var links=""" & links & """;"
Response.Write " var texts=""" & texts & """;"
Response.Write " var focus_width=" & Width & ";"
Response.Write " var focus_height=" & Height - 18 & ";"
Response.Write " var text_height=18;"
Response.Write " var swf_height = focus_height + text_height;"
Response.Write " Ok3w_insertFlash(""" & Htmldns & """, focus_width, focus_height, swf_height, text_height, pics, links, texts);"
Response.Write "}"
Response.Write RndFun & "();"
Response.Write "</script>"
End Sub
在http://www.jrzgltzzs.cn中可以查看效果,IE、Safari、chrome可以正常显示,Firefox、opera不显示,为了不至于空白,本人在
<%Call Ok3w_Article_ImgFlash("",322,280)%>调用代码之后加了一段js代码,针对这两个浏览器输出另一个flash。
下面是这段图片滚播的js代码,请高人分析哪里出了问题,应该如何修改?上述网站是本人的第一个web,很业余很垃圾,恳求指点,呵呵
Private Sub Ok3w_Article_ImgFlash(ClassID,Width,Height)
Randomize
RndID = Int(Rnd()*10000)
RndFun = "__Ok3w_Article_ImgFlash__00" & RndID
Response.Write "<script type=""text/javascript"">"
Response.Write "function " & RndFun & "()"
Response.Write "{"
Sql="select top 5 Id,Title,PicFile,TitleColor,TitleURL from Ok3w_Article where ChannelID=1 and IsPass=1 and IsPlay=1 and IsDelete=0"
If ClassID<>"" Then Sql=Sql & " and SortPath like '%," & ClassID & ",%'"
Sql=Sql & " order by IsTop desc,IsCommend desc,Id desc"
Rs.Open Sql,Conn,0,1
pics = ""
links = ""
texts = ""
Do While Not Rs.Eof
ID = Rs("ID")
Title = Rs("Title")
PicFile = ReplaceUpFilePath(Rs("PicFile"))
TitleURL = Rs("TitleURL")
If TitleURL = "" Then TitleURL = Page_URL(ChannelID,"",ID)
pics = pics & PicFile & "|"
links = links & TitleURL & "|"
texts = texts & Title & "|"
Rs.MoveNext
Loop
Rs.Close
If texts<>"" Then
pics = Left(pics,Len(pics)-1)
links = Left(links,Len(links)-1)
texts = Left(texts,Len(texts)-1)
End If
Response.Write " var pics=""" & pics & """;"
Response.Write " var links=""" & links & """;"
Response.Write " var texts=""" & texts & """;"
Response.Write " var focus_width=" & Width & ";"
Response.Write " var focus_height=" & Height - 18 & ";"
Response.Write " var text_height=18;"
Response.Write " var swf_height = focus_height + text_height;"
Response.Write " Ok3w_insertFlash(""" & Htmldns & """, focus_width, focus_height, swf_height, text_height, pics, links, texts);"
Response.Write "}"
Response.Write RndFun & "();"
Response.Write "</script>"
End Sub
作者: mortimer512 发布时间: 2010-05-31
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28