Pass Asp variable to java.

Discussion in 'Javascript' started by ckerns@refuse.net, Apr 11, 2005.

  1. Guest

    I have a recordset (ADO) that I loop thru in ASP.

    How can I also assign these values to a java variable?

    tia

    ck
     
    , Apr 11, 2005
    #1
    1. Advertisements

  2. Erwin Moller Guest

    wrote:

    > I have a recordset (ADO) that I loop thru in ASP.
    >
    > How can I also assign these values to a java variable?


    A Java variable?
    Are you confusing Java with Javascript maybe?

    If you are, and mean Javascript, try something like this:

    <script type="text/javascript">
    <%
    Dim count
    count = 0
    Do While Not(RS.EOF)
    count = count + 1
    %>
    var myJSvar<%= count %> = "<%= RS("name") %>";
    <%
    Loop
    %>

    </script>


    Then just look into the HTML produced by the ASP if the result fit your
    needs. (View source)

    In the case you really mean Java, things get more complicated, and the
    answer will depend on what you actually want to accomplish. (eg applet)

    Hope this helps,
    Regards,
    Erwin Moller

    >
    > tia
    >
    > ck
     
    Erwin Moller, Apr 11, 2005
    #2
    1. Advertisements

  3. Erwin Moller Guest

    Erwin Moller wrote:

    > wrote:
    >
    >> I have a recordset (ADO) that I loop thru in ASP.
    >>
    >> How can I also assign these values to a java variable?

    >
    > A Java variable?
    > Are you confusing Java with Javascript maybe?
    >
    > If you are, and mean Javascript, try something like this:
    >
    > <script type="text/javascript">
    > <%
    > Dim count
    > count = 0
    > Do While Not(RS.EOF)
    > count = count + 1
    > %>
    > var myJSvar<%= count %> = "<%= RS("name") %>";
    > <%


    correction: add RS.movenext here

    > Loop
    > %>
    >
    > </script>
    >
    >
    > Then just look into the HTML produced by the ASP if the result fit your
    > needs. (View source)
    >
    > In the case you really mean Java, things get more complicated, and the
    > answer will depend on what you actually want to accomplish. (eg applet)
    >
    > Hope this helps,
    > Regards,
    > Erwin Moller
    >
    >>
    >> tia
    >>
    >> ck
     
    Erwin Moller, Apr 12, 2005
    #3
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?QXVndXN0byBDZXNhcg==?=

    Pass ASP Array variable to Javascript

    =?Utf-8?B?QXVndXN0byBDZXNhcg==?=, Nov 6, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    16,012
    Mike Moore [MSFT]
    Nov 6, 2003
  2. Wayne  Wengert

    Pass a Session Variable from ASP.NET to ASP

    Wayne Wengert, Apr 2, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    13,381
    swati254
    Jun 17, 2008
  3. Beffmans
    Replies:
    2
    Views:
    1,391
    Eliyahu Goldin
    Mar 23, 2006
  4. Replies:
    0
    Views:
    709
  5. Ben Kial
    Replies:
    1
    Views:
    927
    Eric Enright
    Nov 15, 2004
  6. mfglinux
    Replies:
    11
    Views:
    962
    Roberto Bonvallet
    Sep 12, 2007
  7. Tricky
    Replies:
    0
    Views:
    782
    Tricky
    Mar 19, 2009
  8. David Filmer
    Replies:
    19
    Views:
    504
    Kevin Collins
    May 21, 2004
Loading...