Results 1 to 2 of 2

Thread: VB and JS

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 1999
    Location
    Passaic, NJ, USA
    Posts
    4

    Question

    how would i pass an asp database value such as database.RecordCount to a javascript variable...?

  2. #2
    Hyperactive Member
    Join Date
    Mar 2000
    Posts
    292
    I'm assuming you are talking about serverside VBScript and client side JS, then you can do something like this:

    <%@ Language=VBScript %>
    <%
    Dim myVBVar
    myVBVar = "xxx"
    %>
    <html>
    <head>
    <title>My Website</title>
    <Script language = "Javascript">
    <!--Hide from old browsers
    var myJSVar = "<% = myVBVar %>";
    alert(myJSVar);
    //-->
    </Script>
    </head>
    <body>
    my page
    blah
    more of my page
    </body>
    </html>
    "People who think they know everything are a great annoyance to those of us who do."

Posting Permissions

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



Click Here to Expand Forum to Full Width