Results 1 to 4 of 4

Thread: Ultimate Fade-in slideshow (v2.4) asp database problem

  1. #1
    Join Date
    Jul 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Ultimate Fade-in slideshow (v2.4) asp database problem

    1) Script Title: Ultimate Fade-in slideshow (v2.4)

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...nslideshow.htm

    3) Describe problem: I've install the script to load records from asp sql database but it's still working on FF not working on IE

    Code:
    <script type="text/javascript" src="/images/jquery.min.js"></script>
    <script type="text/javascript" src="/images/fadeslideshow.js"></script>
    
    <script type="text/javascript">
    
    var mygallery=new fadeSlideShow({
    	wrapperid: "fadeshow1", //ID of blank DIV on page to house Slideshow
    	dimensions: [700, 302], //width/height of gallery in pixels. Should reflect dimensions of largest image
    	imagearray: [
    		<%
    		Set RS= Server.CreateObject("ADODB.Recordset")
    		strSQL = "SELECT * FROM tbl_linkadv WHERE l_active=1 and l_position=5 ORDER BY l_order ASC"
    		RS.Open strSQL,ketnoi,3,1		
    		If not RS.EOF and not RS.BOF then
    		Do While not RS.EOF
    		i=1
    		if i<rs.recordcount then		
    		%>
    		["<%=rs("l_image")%>", "", "", "<%=rs("l_name")%>"],
    		<%else%>
    		["<%=rs("l_image")%>", "", "", "<%=rs("l_name")%>"]
    		<%
    		end if
    		i=i+1		
    		RS.MoveNext
    		Loop					
    		End if
    		RS.Close
    		call closeDatabase()
    		%>		
    		
    	],
    	displaymode: {type:'auto', pause:5000, cycles:0, wraparound:false},
    	persist: false, //remember last viewed slide and recall within same session?
    	fadeduration: 1000, //transition duration (milliseconds)
    	descreveal: "peekaboo",
    	togglerid: ""
    })
    </script>
    
    	<div id="fadeshow1"></div>
    Please help me to resolve this problem.Thanks so much!
    Last edited by bokinhvan888; 07-22-2012 at 03:57 PM.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    That indicates to me that even though you have:

    Code:
    		if i<rs.recordcount then		
    		%>
    		["<%=rs("l_image")%>", "", "", "<%=rs("l_name")%>"],
    		<%else%>
    		["<%=rs("l_image")%>", "", "", "<%=rs("l_name")%>"]
    		<%
    		end if
    A comma is being placed after the last imagearray element. I think you need a nested if then in there. Something like:

    Code:
    		if i<rs.recordcount then
    			if i<rs.recordcount - 1 then	
    			%>
    				["<%=rs("l_image")%>", "", "", "<%=rs("l_name")%>"],
    			<%else%>
    				["<%=rs("l_image")%>", "", "", "<%=rs("l_name")%>"]
    			<%
    			end if
    		end if
    In any case, look at the served source code of the page -

    While the page is in the browser, use the browser's 'View Source'. Look at the array. There should be no comma after the last imagearray element. If there is one there, IE will throw an error. You will have to adjust your asp code until that comma is removed. Other browsers error correct for this, but technically no comma is allowed after the last item in a javascript array or the last property in a javascript object.

    If you want more help, please include a link to the page on your site that contains the problematic code so we can check it out.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Jul 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks jscheuer1. I have fixed the code as your comment but it's still having comma for the last item. How to remove it?
    Last edited by bokinhvan888; 07-22-2012 at 03:57 PM.

  4. #4
    Join Date
    Jul 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    ok.i fixed it.the code shoule be :-)
    Code:
    i=1
    Do While not RS.EOF
    Please close the topic.
    Thanks jscheuer1!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •