Results 1 to 2 of 2

Thread: Javascript with ASP error

  1. #1
    Join Date
    Jan 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Javascript with ASP error

    I am trying to list records from an access database. these records will be listed 2 in a row, ASP part of the codesare working but I couldn't manage to run the code in javascrip side. it keeps giving me an error message saying that Expected ';'
    How I can get make it working?

    Code:
    var fcontent=new Array();
    begintag='<div>'; //set opening tag, such as font declarations
    
    <%
    sayi=-1
    do while NOT rs.EOF
    sayi=sayi+1
    %>
    
    fcontent[<%=sayi%>]='<h1><%=rs("Heading")%></h1><p><%=rs("Content")%><br><div align='right'><a href='<%=rs("link")%>'>Read more</a></div></p> '+
    <% 
    rs.movenext
    if not rs.Eof then
    %>
    ' <hr><p><h1><%=rs("Heading")%></h1><p><%=rs("Content")%><br><div align='right'><a href='<%=rs("link")%>'>Read more</a></div></p>';
    
    <%
    rs.movenext
    end if
    loop
    %>
    
    closetag='</div>';

  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 sounds like an IE error message, one of, if not the most vague error reporting mechanisms in most cases.

    The easiest way to debug this kind of situation that I know of (there are others, and it depends to a degree upon personal preference) is to set up the page live. Then view the source code in a browser (my favorite for this is Firefox, with developer tools added) guided by any error(s) reported. This will show what the browser is receiving from the server, so all server side code (if it is executing as expected, as you state) is taken out of the equation. Any javascript errors will then be more easily diagnosed.

    If you want more help on this one, post a link to your live page that demonstrates the problem.
    - John
    ________________________

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

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
  •