Js and asp in the database picture show

  <table Width="100%" border="0" align="center" cellspacing="0" cellpadding="0" style="TABLE-LAYOUT: fixed"> 
<%
  Sql = "select top 4 * from Ad where checked = true" 
  Rs.Open sql, conn, 1,1 
  If not rs.eof then 
  N = 0 
  While not rs.EOF 
  N = n +1 
%>
  <% = Rs ( "AdSitePic")%> 
<%
  Rs.MoveNext 
  Wend 
%>
  <td Width="100%" height="220"> 
  <script Language="JavaScript1.2"> 

  Var slideshow_width'200px = '/ / SET SLIDESHOW WIDTH (set to largest image's width if multiple dimensions exist) 
  Var slideshow_height'200px = '/ / SET SLIDESHOW HEIGHT (set to largest image's height if multiple dimensions exist) 
  Var pause = 3000 / / SET PAUSE BETWEEN SLIDE (2000 = 2 seconds) 
  Var slidebgcolor = "white" 

  Var dropimages = new Array () 

  Dropimages [0] = "<img src ="<%= rs (" AdSitePic ")%>" width = "128" height = "128"> " 
  Dropimages [1] = "<img src ="<%= rs (" AdSitePic ")%>" width = "128" height = "128"> " 
  Dropimages [2] = "<img src ="<%= rs (" AdSitePic ")%>" width = "128" height = "128"> " 

  Var droplinks = new Array () 

  Droplinks [0] = www.airsend.com 
  Droplinks [1] = www.sina.com 
  Droplinks [2] = www.baidu.com 

  Var preloadedimages = new Array () 
  For (p = 0, p <dropimages.length; p + +) ( 
  Preloadedimages [p] = new Image () 
  Preloadedimages [p]. Dropimages src = [p] 
  ) 

  Var ie4 = document.all 
  Var dom = document.getElementById 

  If (ie4 | | dom) 
  Document.write ( '<div style="position:relative;width:'+slideshow_width+';height:'+slideshow_height+';overflow:hidden"> <div id = "canvas0" style = "position: absolute; width:' slideshow_width + + '; height:' + slideshow_height + '; background-color:' + slidebgcolor + '; left: -' + slideshow_width +'"></ div> <div id = "canvas1" style = "position: absolute; width: ' slideshow_width + + '; height:' + slideshow_height + '; background-color:' + slidebgcolor + '; left: -' + slideshow_width +'"></ div> </ div> ') 
  Else 
  Document.write ( '<a href="javascript:rotatelink()"> <img name="defaultslide" src="'+dropimages[0]+'" border=0> </ a>') 

  Var curpos = parseInt (slideshow_width) * (-1) 
  Var degree = 10 
  Var curcanvas = "canvas0" 
  Var curimageindex linkindex = 0 = 
  Var nextimageindex = 1 


  Function movepic () ( 
  If (curpos <0) ( 
  Curpos = Math.min (curpos + degree, 0) 
  Curpos tempobj.style.left = + "px" 
  ) 
  Else ( 

  ClearInterval (dropslide) 
  Nextcanvas = (curcanvas == "canvas0")? "Canvas0": "canvas1" 
  Tempobj = ie4? Eval ( "document.all." Nextcanvas +): document.getElementById (nextcanvas) 
  Var slideimage = '<img src="'+dropimages[curimageindex]+'" border=0>' 
  Tempobj.innerHTML = (droplinks [curimageindex ]!="")? '<a href="'+droplinks[curimageindex]+'">' + slideimage + '</ a>': slideimage 
  Nextimageindex = (nextimageindex <dropimages.length-1)? Nextimageindex +1: 0 
  SetTimeout ( "rotateimage ()," pause) 
  ) 
  ) 

  Function rotateimage () ( 
  If (ie4 | | dom) ( 
  Resetit (curcanvas) 
  = = Var crossobj tempobj ie4? Eval ( "document.all." Curcanvas +): document.getElementById (curcanvas) 
  Crossobj.style.zIndex + + 
  Var temp = 'setInterval ( "movepic ()", 50)' 
  Dropslide = eval (temp) 
  Curcanvas = (curcanvas == "canvas0")? "Canvas1": "canvas0" 
  ) 
  Else 
  Dropimages document.images.defaultslide.src = [curimageindex] 
  Linkindex = curimageindex 
  Curimageindex = (curimageindex <dropimages.length-1)? Curimageindex +1: 0 
  ) 

  Function rotatelink () ( 
  If (droplinks [linkindex ]!="") 
  Window.location = droplinks [linkindex] 
  ) 

  Function resetit (what) ( 
  Curpos = parseInt (slideshow_width) * (-1) 
  Var crossobj = ie4? Eval ( "document.all." What +): document.getElementById (what) 
  Curpos crossobj.style.left = + "px" 
  ) 

  Function startit () ( 
  Var crossobj = ie4? Eval ( "document.all." Curcanvas +): document.getElementById (curcanvas) 
  Crossobj.innerHTML = '<a href="'+droplinks[curimageindex]+'"> <img src="'+dropimages[curimageindex]+'" border=0> </ a>' 
  Rotateimage () 
  ) 

  If (ie4 | | dom) 
  Window.onload = startit 
  Else 
  SetInterval ( "rotateimage ()," pause) 

  </ Script> 

  </ Td> 
<%
  Else 
  Response.Write "<tr> <td> <center> <b> not content </ b> </ center> </ td> </ tr>" 
  End if 
  Rs.close 
  Set rs1 = nothing 
%>
  </ Table> 

  Younger brother to the website shows that the dynamic picture with the picture from the changes to the database connectivity adsitepic picture in the ad url But there is no problem connecting to the database once the asp to js not in the picture show 

  <% = Rs ( "AdSitePic")%> displays the correct url 

  Will you master how to resolve this problem 


Bookmark it: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Sphinn
  • del.icio.us
  • Google
  • DotNetKicks
  • DZone
  • Furl
  • Netvouz

Tags: , ,

Releated Articles


0 Comments to “Js and asp in the database picture show”

No Comments. Send your comment.

Leave a Reply

You must be logged in to post a comment.