var pics='&co(0)&' ??加链接符是什么意思?
解决方案 »
- cuteeditor 本地测试好着,上传后界面显示不了,而且无法编辑内容
- 控制弹出窗口
- 请教firefox的js兼容性问题
- 用document.createElement("input");创建的文本框,为什么得不到它的值
- <button>标签中 当鼠标按住它不放时 javascript有什么办法强迫它松开鼠标?
- <input type=text name='T[]'>Js如果引用?
- 在 javascript中怎样,用哪个函数把字符窜转化成整数啊
- jsp在weblogic中运行的问题?
- 【求助】求jquery修改a标签属性的正确写法
- jsp input 问题
- 页面与iframe交互的问题
- 请帮我写一行js代码,可能需要正则表达式知识,高手可能只需要一行
var links='&co(0)&'
var texts='+&ti(0)&+'
我就这3段不会写 不知道怎么写~
dim rsa,sqla,k,ti(),co()
for i = 0 to 5
ReDim Preserve ti(i)
ReDim Preserve co(i)
ti(i)=i
co(i)=i
next set rsa=server.createobject("adodb.recordset")
sqla="select top 5 * from tupian where IsElite=1"
rsa.open sqla,conn,1,1
k=0
do while not rsa.eof
ti(k)=rsa("Content")
co(k)=rsa("DefaultPicUrl")
rsa.movenext
k=k+1
loop
rsa.close
%>
<script type="text/javascript">
<!-- var focus_width=323
var focus_height=220
var text_height=20
var swf_height = focus_height+text_height
//================================================
var pics=new Arrary()
var links=new Arrary()
var texts=new Arrary()
<%
for i=0 to ubound(ti)
response.write "pics.push('"&co(i)&"');"&vbnewline
response.write "links.push('"&co(i)&"');"&vbnewline
response.write "texts.push('"&replace(ti(i),"'","\'")&"');"&vbnewline
next
%>
//================================================document.write(' <object ID="focus_flash" 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="images/pixviewer.swf"> <param name="quality" value="high"> <param name="bgcolor" value="#ffffff">');
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 ID="focus_flash" src="images/pixviewer.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 +'" height="'+ focus_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
document.write(' </object>'); //-->
</script>
var pics='图片路径|图片路径'
var links='链接地址|链接地址'
var texts='链接文字|链接文字'内容是一一对应的...
rs.CursorLocation = 3
rs.open "select top 5 * from tupian where IsElite=1"
If Not (rs.eof and rs.bof) Then
arr = rs.GetRows()
End If
rs.close
set rs = Nothing
就这样就能直接得到数组
没有必要自己组合数组
var links=new Array(<%=UBound(arr,2)%>);
var texts=new Array(<%=UBound(arr,2)%>);
这样定义那么就是一个数组了
var pics='图片路径|图片路径'
var links='链接地址|链接地址'
var texts='链接文字|链接文字' 内容是一一对应的...他原来是是这样 网上找的代码 我想把这里改成读取数组的值
rs.CursorLocation = 3
rs.open "select top 5 * from tupian where IsElite=1"
If Not (rs.eof and rs.bof) Then
arr = rs.GetRows()
End If
rs.close
set rs = Nothing
%>
<script>var pics;
var links;
var texts;
for(var j=0;j<=<%=UBound(arr,2)%>;j++){
if(pic==""){
pics="<%=arr(1,i)%>"//1是代表你图片字段在数据库中的位置
links="<%=arr(2,i)%>"//2是代表你URL字段在数据库中的位置
texts="<%=arr(3,i)%>"//3是代表你标题字段在数据库中的位置
}
else{
pics=pics+"|"+"<%=arr(1,i)%>"//1是代表你图片字段在数据库中的位置
links=links+"|"+"<%=arr(2,i)%>"//2是代表你URL字段在数据库中的位置
texts=texts+"|"+"<%=arr(3,i)%>"//3是代表你标题字段在数据库中的位置
}
}
document.write(' <object ID="focus_flash" 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="images/pixviewer.swf"> <param name="quality" value="high"> <param name="bgcolor" value="#ffffff">');
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 ID="focus_flash" src="images/pixviewer.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 +'" height="'+ focus_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
document.write(' </object>');
</script> 试试看效果,我随手写的
for(var j=0;j<=<%=UBound(arr,2)%>;j++){
这里应该是i
var focus_height=220
var text_height=20
var swf_height = focus_height+text_height
呵呵,你这部分我没复制进去,自己复制进去就可以了
<%
dim rsa,sqla,k,ti,co'=========ti="":co=""
set rsa=server.createobject("adodb.recordset")
sqla="select top 5 * from tupian where IsElite=1"
rsa.open sqla,conn,1,1
do while not rsa.eof
'连接成需要的数据
ti=ti&"|"&replace(rsa("Content"),"'","\'")
co=co&"|"&rsa("DefaultPicUrl")
rsa.movenext
loop
rsa.close
if ti<>"" then ti=right(ti,len(ti)-1)
if co<>"" then co=right(co,len(ti)-1)
%>
<script type="text/javascript">
<!-- var focus_width=323
var focus_height=220
var text_height=20
var swf_height = focus_height+text_height
//================================================
var pics='<%=co%>'
var links='<%=co%>'
var texts='<%=ti%>'
//================================================document.write(' <object ID="focus_flash" 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="images/pixviewer.swf"> <param name="quality" value="high"> <param name="bgcolor" value="#ffffff">');
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 ID="focus_flash" src="images/pixviewer.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 +'" height="'+ focus_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
document.write(' </object>'); //-->
</script>
那要改flash里的as吧,他里面肯定 split了