设为首页收藏本站

新微赢技术网

 找回密码
 注册
搜索
热搜: 回贴
查看: 97|回复: 2
打印 上一主题 下一主题

[求助]javascript中加入asp

[复制链接]
跳转到指定楼层
1#
发表于 2010-1-17 06:27:08 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
我想要在的javascript中添加入asp,就是直接在代码中调用数据库中的链接,请问如何做到呢????
急急急
<!--#include file="news/conn.asp"-->
<script LANGUAGE="javascript">
<!--
var cpAD=new Array();
var cpADlink=new Array();
var cpADmsg=new Array();
var adNum=5; file://?¨ò?á?5??êy×é
var coll=0;
cpAD[0]="image/123.jpg"; file://á′?óí???
cpADlink[0]=""; file://á′?óURL
cpADmsg[0]=""; file://×′ì?à?ìáê?D??¢
cpAD[1]="image/456.jpg";
cpADlink[1]=""
cpADmsg[1]="";
cpAD[2]="image/789.jpg";
cpADlink[2]="";
cpADmsg[2]="";
cpAD[3]="image/011.jpg";
cpADlink[3]="";
cpADmsg[3]="";
cpAD[4]="image/012.jpg";
cpADlink[4]="";
cpADmsg[4]="";
var preloadedimages=new Array();
for (i=1;i<cpAD.length;i++){
preloadedimages[i]=new Image();
preloadedimages[i].src=cpAD[i];
}
file://ì?×aμ?URLμ??·
function jump2url()
{
jumpUrl=cpADlink[adNum];
jumpTarget='_blank';
if (jumpUrl != '')
{
if (jumpTarget != '')
window.open(jumpUrl,jumpTarget);
else location.href=jumpUrl;
}
}
file://í???±??ˉμ?oˉêy
function changeimg(n)
{
adNum=n;
switch(adNum)
{
case 0:
{
window.img1.src="image/1-2.gif";
window.img2.src="image/2.gif";
window.img3.src="image/3.gif";
window.img4.src="image/4.gif";
window.img5.src="image/5.gif";
break;
}
case 1:
{
window.img1.src="image/1.gif";
window.img2.src="image/2-2.gif";
window.img3.src="image/3.gif";
window.img4.src="image/4.gif";
window.img5.src="image/5.gif";
break;
}
case 2:
{
window.img1.src="image/1.gif";
window.img2.src="image/2.gif";
window.img3.src="image/3-2.gif";
window.img4.src="image/4.gif";
window.img5.src="image/5.gif";
break;
}
case 3:
{
window.img1.src="image/1.gif";
window.img2.src="image/2.gif";
window.img3.src="image/3.gif";
window.img4.src="image/4-2.gif";
window.img5.src="image/5.gif";
break;
}
case 4:
{
window.img1.src="image/1.gif";
window.img2.src="image/2.gif";
window.img3.src="image/3.gif";
window.img4.src="image/4.gif";
window.img5.src="image/5-2.gif";
break;
}
}
window.clearInterval(theTimer);
adNum=adNum-1;
nextAd();
}
file://μ±μ??÷ê±?±?óì?×a
function nextAd(){
coll++;
if(coll>1)
{
switch(adNum+1)
{
case 5:
{
window.img1.src="image/1-2.gif";
window.img2.src="image/2.gif";
window.img3.src="image/3.gif";
window.img4.src="image/4.gif";
window.img5.src="image/5.gif";
break;
}
case 1:
{
window.img1.src="image/1-2.gif";
window.img2.src="image/2-2.gif";
window.img3.src="image/3.gif";
window.img4.src="image/4.gif";
window.img5.src="image/5.gif";
break;
}
case 2:
{
window.img1.src="image/1-2.gif";
window.img2.src="image/2.gif";
window.img3.src="image/3-2.gif";
window.img4.src="image/4.gif";
window.img5.src="image/5.gif";
break;
}
case 3:
{
window.img1.src="image/1-2.gif";
window.img2.src="image/2.gif";
window.img3.src="image/3.gif";
window.img4.src="image/4-2.gif";
window.img5.src="image/5.gif";
break;
}
case 4:
{
window.img1.src="image/1-2.gif";
window.img2.src="image/2.gif";
window.img3.src="image/3.gif";
window.img4.src="image/4.gif";
window.img5.src="image/5.gif";
break;
}
}
}
if(adNum<cpAD.length-1)adNum++ ;
else adNum=0;
setTransition();
document.images.cpADrush.src=cpAD[adNum];
playTransition();
displayStatusMsg();
file://?¨ò?á?????ê±?? 5s
theTimer=setTimeout("nextAd()", 5000);
}
function setTransition(){
if (document.all){
cpADrush.filters.revealTrans.Transition=23;
cpADrush.filters.revealTrans.apply();
}
}
function playTransition(){
if (document.all)
cpADrush.filters.revealTrans.play()
}
function displayStatusMsg() {
status=cpADmsg[adNum];
document.returnValue = true;
}
file://?áê?
// -->
</script>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="219" height="465" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="235" colspan="3"><table id="Table_01" width="210" height="256" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="3"> <img src="Images/1.gif" width="210" height="29" alt=""></td>
</tr>
<tr>
<td rowspan="2"> <img src="Images/2.gif" width="10" height="227" alt=""></td>
<td width="191">
<table height="148" cellspacing="0" cellpadding="0">
<tr>
<td width="191"> <a href="javascript:jump2url()"> <img style="FILTER: revealTrans
(duration=2,transition=23)" height="140" src width="191" border="0"
name="cpADrush"></a></td>
<script language="JavaScript">nextAd()</script>
</tr>
<tr>
<td>
<table width="191" name="T1" id="T1" border="0" cellspacing="1" cellpadding="0">
<tr>
<td align="right"><img src="image/dh_bg.gif" width="80"
height="16"></td>
<td width="20"><a href="javascript:;" onMouseOver="changeimg(0)"><img name="Image2"
id="img1" border="0" src="image/1.gif" width="20"
height="16" onClick="changeimg(0)"></a></td>
<td width="20"><a href="javascript:;" onMouseOver="changeimg(1)"><img name="Image3"
id="img2" border="0" src="image/2.gif" width="20"
height="16" onClick="changeimg(1)"></a></td>
<td width="20"><a href="javascript:;" onMouseOver="changeimg(2)"><img name="Image4"
id="img3" border="0" src="image/3.gif" width="20"
height="16" onClick="changeimg(2)"></a></td>
<td width="20"><a href="javascript:;" onMouseOver="changeimg(3)"><img name="Image5"
id="img4" border="0" src="image/4.gif" width="20"
height="16" onClick="changeimg(3)"></a></td>
<td width="20"><a href="javascript:;" onMouseOver="changeimg(4)"><img name="Image6"
id="img5" border="0" src="image/5.gif" width="20"
height="16" onClick="changeimg(4)"></a></td>
</tr>
</table>
</td>
</tr>
</table></td>
<td rowspan="2"> <img src="Images/4.gif" width="9" height="227" alt=""></td>
</tr>
<tr>
<td> <img src="Images/5.gif" width="191" height="71" alt=""></td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="3"> <div align="center"></div></td>
</tr>
<tr>
<td colspan="3"><img src="Images/right_03.gif" width="219" height="48">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<td height="26" class="font1">
<marquee id='news' height="80" scrollamount='1' scrolldelay='10' behavior='loop' direction='up' border='0' onmouseover='this.stop()' onmouseout='this.start()'>
<div align="center">
<table width="177" height="34" border="0" cellpadding="0" cellspacing="0" dwcopytype="CopyTableCell">
<tr>
<td width="177" height="50" rowspan="3" valign="top">
<%set rs2=server.CreateObject("adodb.recordset")
sql2="select top 8 * from news where classid='5' order by id desc"
rs2.open sql2,conn,1,1
%>
<div align="center">
<table width="161" border="0" align="center">
<tr>
<td width="155" height="39" valign="top" class="font1">
<% if rs2.bof and rs2.eof then
response.write("?1??óDD???£?")
else
do while not rs2.eof%>
<img src="Images/ico.gif" width="10" height="9"><a href="newsmore.asp?id=<%=rs2("id")%>" target="_blank" title="<%=rs2("title")%>">
&nbsp;<%=left(rs2("title"),15)%></a><br>
<%rs2.movenext
loop
end if
rs2.close
set rs2=nothing%>
</td>
</tr>
2#
发表于 2010-2-8 22:05:06 | 只看该作者
哈哈,有意思~顶顶 ,继续顶顶。继续顶哦
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

申请友链|小黑屋|最新主题|手机版|新微赢技术网 ( 苏ICP备08020429号 )  

GMT+8, 2024-11-18 13:56 , Processed in 0.088056 second(s), 9 queries , Gzip On, Memcache On.

Powered by xuexi

© 2001-2013 HaiAn.Com.Cn Inc. 寰耽

快速回复 返回顶部 返回列表