Using ASP Variables

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Craig L

    Using ASP Variables

    I use ASP to obtain data from a database and I have a piece of javascript
    code I use on my website. I want to use the database variables in my
    javascript. I'm not very familiar with javascript, but here is some info
    similar to what I'm trying to do.

    <%
    strFirstName=se ssion("FirstNam e") ASP code
    strLastName=ses sion("LastName" )
    %>

    The javascript code I want to use the variables in.
    Items[1]=["First Name", strFirstName,""]
    Items[2]=["Last Name", strLastName,""]

    Please help or point me to a website with this solution. Thanks much for
    your help.

    Craig

    w1zard@hotSPAMm ail.com (remove SPAM before sending)


  • bengee

    #2
    Re: Using ASP Variables

    Craig L wrote:[color=blue]
    > I use ASP to obtain data from a database and I have a piece of javascript
    > code I use on my website. I want to use the database variables in my
    > javascript. I'm not very familiar with javascript, but here is some info
    > similar to what I'm trying to do.
    >
    > <%
    > strFirstName=se ssion("FirstNam e") ASP code
    > strLastName=ses sion("LastName" )
    > %>
    >
    > The javascript code I want to use the variables in.
    > Items[1]=["First Name", strFirstName,""]
    > Items[2]=["Last Name", strLastName,""][/color]

    You can't access the ASP variables directly, because ASP is done on the
    server, and Javascript is on the client (web browser). By the time the
    Javascript is "executing" the ASP has already finished.

    You can try this though :-

    Items[1]=["First Name", "<%=strFirstNam e%>",""]
    Items[2]=["Last Name", "<%=strLastName %>",""]

    HTH!

    bengee

    Comment

    • Mike

      #3
      Re: Using ASP Variables

      I've done something like the following to get ASP variables into javascript

      <%
      strFirstName = (whatever you want it to equal)
      strLastName = (whatever you want it to equal)

      Response.Write "<script language=JavaSc ript>"
      Response.Write "var sFirstName=" & strFirstName
      Response.Write "var sLastName=" & strLastName
      Response.Write "</script>"

      Now, the variables sFirstName and sLastName are available to your JavaScript

      What you have done, is written a <script> block via ASP that gives you
      JavaScript variables....

      Mike

      "Craig L" <w1zard10@hotSP AMmail.com> wrote in message
      news:w8idnfGM2J ozaTqiRVn-tw@comcast.com. ..[color=blue]
      > I use ASP to obtain data from a database and I have a piece of javascript
      > code I use on my website. I want to use the database variables in my
      > javascript. I'm not very familiar with javascript, but here is some info
      > similar to what I'm trying to do.
      >
      > <%
      > strFirstName=se ssion("FirstNam e") ASP code
      > strLastName=ses sion("LastName" )
      > %>
      >
      > The javascript code I want to use the variables in.
      > Items[1]=["First Name", strFirstName,""]
      > Items[2]=["Last Name", strLastName,""]
      >
      > Please help or point me to a website with this solution. Thanks much for
      > your help.
      >
      > Craig
      >
      > w1zard@hotSPAMm ail.com (remove SPAM before sending)
      >
      >[/color]


      Comment

      • Craig L

        #4
        Re: Using ASP Variables

        Bengee:
        Thanks for the help. the <%= info didn't help. Do you know if the javascript
        code can use it if I create a session object for the variable? I tried some
        of this with no luck.

        Craig

        "bengee" <postmaster@loc alhost.localdom ain> wrote in message
        news:L8Tpb.4373 $lm1.25627@ward s.force9.net...[color=blue]
        > Craig L wrote:[color=green]
        > > I use ASP to obtain data from a database and I have a piece of[/color][/color]
        javascript[color=blue][color=green]
        > > code I use on my website. I want to use the database variables in my
        > > javascript. I'm not very familiar with javascript, but here is some info
        > > similar to what I'm trying to do.
        > >
        > > <%
        > > strFirstName=se ssion("FirstNam e") ASP code
        > > strLastName=ses sion("LastName" )
        > > %>
        > >
        > > The javascript code I want to use the variables in.
        > > Items[1]=["First Name", strFirstName,""]
        > > Items[2]=["Last Name", strLastName,""][/color]
        >
        > You can't access the ASP variables directly, because ASP is done on the
        > server, and Javascript is on the client (web browser). By the time the
        > Javascript is "executing" the ASP has already finished.
        >
        > You can try this though :-
        >
        > Items[1]=["First Name", "<%=strFirstNam e%>",""]
        > Items[2]=["Last Name", "<%=strLastName %>",""]
        >
        > HTH!
        >
        > bengee
        >[/color]


        Comment

        • bengee

          #5
          Re: Using ASP Variables

          Craig L wrote:[color=blue]
          > Bengee:
          > Thanks for the help. the <%= info didn't help. Do you know if the javascript
          > code can use it if I create a session object for the variable? I tried some
          > of this with no luck.[/color]

          There's no way Javascript can access an ASP variable. However,
          Javascript is the "output" from the ASP code, so you can set a
          Javascript variable to be that of an ASP variable. Once this is set
          though and being viewed in the browser, you can't change it server-side
          without some sort of re-sumbit mechanism.

          Have a look a Mike's example below.

          bengee

          Comment

          • Craig L

            #6
            Re: Using ASP Variables

            Bengee:
            I'm trying what Mike mentioned since it really makes sense; getting ASP to
            generate the javascript code, but it doesn't work for me yet. I have the
            response.buffer =True set. Not sure what I'm doing wrong.

            Craig

            "bengee" <postmaster@loc alhost.localdom ain> wrote in message
            news:tHUpb.4415 $lm1.25943@ward s.force9.net...[color=blue]
            > Craig L wrote:[color=green]
            > > Bengee:
            > > Thanks for the help. the <%= info didn't help. Do you know if the[/color][/color]
            javascript[color=blue][color=green]
            > > code can use it if I create a session object for the variable? I tried[/color][/color]
            some[color=blue][color=green]
            > > of this with no luck.[/color]
            >
            > There's no way Javascript can access an ASP variable. However,
            > Javascript is the "output" from the ASP code, so you can set a
            > Javascript variable to be that of an ASP variable. Once this is set
            > though and being viewed in the browser, you can't change it server-side
            > without some sort of re-sumbit mechanism.
            >
            > Have a look a Mike's example below.
            >
            > bengee
            >[/color]


            Comment

            • bengee

              #7
              Re: Using ASP Variables

              Craig L wrote:[color=blue]
              > Bengee:
              > I'm trying what Mike mentioned since it really makes sense; getting ASP to
              > generate the javascript code, but it doesn't work for me yet. I have the
              > response.buffer =True set. Not sure what I'm doing wrong.[/color]

              Post some code here then and let us have a look.


              Comment

              • Mike

                #8
                Re: Using ASP Variables

                Here is my exact code. This page receives a URL as the following
                "NewPage.asp?TB LS=AttMarket&TB LS=ConfComment"

                In ASP, a reference to Request("TBLS") will return the string
                "AttMarket,Conf Comment"

                I take that info and save it into a JavaScript array that I can access
                throughout the page on the client side...
                <preliminary HTML stuff>
                <body onload="Loaded( )">
                <%

                '-- A bunch of code that means nothing as far as your question goes...

                '-- Throw out some JavaScript make it easy to get to the Request
                parameters.
                Response.Write "<script Language=" & chr(34) & "JavaScript " & chr(34) & ">"
                Response.Write "numTables= " & Request("TBLS") .Count & ";"
                Response.Write "allTables = new Array(" & (Request("TBLS" ).Count - 1) &
                ");"
                For i = 1 to Request("TBLS") .Count
                Response.Write "allTables[" & (i - 1) & "] = " & chr(34) &
                Request("TBLS") (i) & chr(34) & ";"
                Next
                Response.Write "</script>"

                '-- More code that means nothing

                %>
                </body>

                This is the code generated (from View->Source)

                <body onload="Loaded( )">
                <script Language="JavaS cript">numTable s=2;allTables = new
                Array(1);allTab les[0] = "AttMarket";all Tables[1] = "ConfCommen t";</script>
                <more html stuff>
                </body>

                Mike

                "bengee" <postmaster@loc alhost.localdom ain> wrote in message
                news:k8Vpb.4431 $lm1.26356@ward s.force9.net...[color=blue]
                > Craig L wrote:[color=green]
                > > Bengee:
                > > I'm trying what Mike mentioned since it really makes sense; getting ASP[/color][/color]
                to[color=blue][color=green]
                > > generate the javascript code, but it doesn't work for me yet. I have the
                > > response.buffer =True set. Not sure what I'm doing wrong.[/color]
                >
                > Post some code here then and let us have a look.
                >
                >[/color]


                Comment

                • Jeff North

                  #9
                  Re: Using ASP Variables

                  On Tue, 4 Nov 2003 16:04:04 -0600, in comp.lang.javas cript "Mike"
                  <mbergerREMOVET HIS@skypoint.co m> wrote:
                  [color=blue]
                  >| Here is my exact code. This page receives a URL as the following
                  >| "NewPage.asp?TB LS=AttMarket&TB LS=ConfComment"
                  >|
                  >| In ASP, a reference to Request("TBLS") will return the string
                  >| "AttMarket,Conf Comment"
                  >|
                  >| I take that info and save it into a JavaScript array that I can access
                  >| throughout the page on the client side...
                  >| <preliminary HTML stuff>
                  >| <body onload="Loaded( )">
                  >| <%
                  >|
                  >| '-- A bunch of code that means nothing as far as your question goes...
                  >|
                  >| '-- Throw out some JavaScript make it easy to get to the Request
                  >| parameters.
                  >| Response.Write "<script Language=" & chr(34) & "JavaScript " & chr(34) & ">"
                  >| Response.Write "numTables= " & Request("TBLS") .Count & ";"
                  >| Response.Write "allTables = new Array(" & (Request("TBLS" ).Count - 1) &
                  >| ");"
                  >| For i = 1 to Request("TBLS") .Count
                  >| Response.Write "allTables[" & (i - 1) & "] = " & chr(34) &
                  >| Request("TBLS") (i) & chr(34) & ";"
                  >| Next
                  >| Response.Write "</script>"
                  >|
                  >| '-- More code that means nothing
                  >|
                  >| %>
                  >| </body>[/color]

                  You are trying to get the javascript to read from the database. This
                  will not work. You need to do this server-side.

                  Have a look at
                  This website is for sale! asp101.com is your first and best source for all of the information you’re looking for. From general topics to more of what you would expect to find here, asp101.com has it all. We hope you find what you are searching for!



                  ---------------------------------------------------------------
                  jnorth@yourpant sbigpond.net.au : Remove your pants to reply
                  ---------------------------------------------------------------

                  Comment

                  • Mike

                    #10
                    Re: Using ASP Variables

                    YES, it will work, and it DOES work....

                    "Jeff North" <jnorth@yourpan tsbigpond.net.a u> wrote in message
                    news:bg8hqv8mfn fj0au3rhj1t1h8g 1qaf25ucr@4ax.c om...[color=blue]
                    > On Tue, 4 Nov 2003 16:04:04 -0600, in comp.lang.javas cript "Mike"
                    > <mbergerREMOVET HIS@skypoint.co m> wrote:
                    >[color=green]
                    > >| Here is my exact code. This page receives a URL as the following
                    > >| "NewPage.asp?TB LS=AttMarket&TB LS=ConfComment"
                    > >|
                    > >| In ASP, a reference to Request("TBLS") will return the string
                    > >| "AttMarket,Conf Comment"
                    > >|
                    > >| I take that info and save it into a JavaScript array that I can access
                    > >| throughout the page on the client side...
                    > >| <preliminary HTML stuff>
                    > >| <body onload="Loaded( )">
                    > >| <%
                    > >|
                    > >| '-- A bunch of code that means nothing as far as your question goes...
                    > >|
                    > >| '-- Throw out some JavaScript make it easy to get to the Request
                    > >| parameters.
                    > >| Response.Write "<script Language=" & chr(34) & "JavaScript " & chr(34)[/color][/color]
                    & ">"[color=blue][color=green]
                    > >| Response.Write "numTables= " & Request("TBLS") .Count & ";"
                    > >| Response.Write "allTables = new Array(" & (Request("TBLS" ).Count - 1)[/color][/color]
                    &[color=blue][color=green]
                    > >| ");"
                    > >| For i = 1 to Request("TBLS") .Count
                    > >| Response.Write "allTables[" & (i - 1) & "] = " & chr(34) &
                    > >| Request("TBLS") (i) & chr(34) & ";"
                    > >| Next
                    > >| Response.Write "</script>"
                    > >|
                    > >| '-- More code that means nothing
                    > >|
                    > >| %>
                    > >| </body>[/color]
                    >
                    > You are trying to get the javascript to read from the database. This
                    > will not work. You need to do this server-side.
                    >
                    > Have a look at
                    > http://www.asp101.com/samples/viewas...db%5Fdsn%2Easp
                    >
                    >
                    > ---------------------------------------------------------------
                    > jnorth@yourpant sbigpond.net.au : Remove your pants to reply
                    > ---------------------------------------------------------------[/color]


                    Comment

                    • Grant Wagner

                      #11
                      Re: Using ASP Variables

                      Craig L wrote:
                      [color=blue]
                      > I use ASP to obtain data from a database and I have a piece of javascript
                      > code I use on my website. I want to use the database variables in my
                      > javascript. I'm not very familiar with javascript, but here is some info
                      > similar to what I'm trying to do.
                      >
                      > <%
                      > strFirstName=se ssion("FirstNam e") ASP code
                      > strLastName=ses sion("LastName" )
                      > %>
                      >
                      > The javascript code I want to use the variables in.
                      > Items[1]=["First Name", strFirstName,""]
                      > Items[2]=["Last Name", strLastName,""]
                      >
                      > Please help or point me to a website with this solution. Thanks much for
                      > your help.
                      >
                      > Craig
                      >
                      > w1zard@hotSPAMm ail.com (remove SPAM before sending)[/color]

                      Trivial:

                      Items[1]=["First Name", "<%= session('FirstN ame') %>",""];
                      Items[2]=["Last Name", "<%= session('LastNa me') %>",""];

                      If <%= %> doesn't evaluate properly inside double-quotes (I'm not sure how
                      ASP deals with this), then you could use something like:

                      Items[1]=["First Name", <%= dquote(session( "FirstName" )) %>,""];
                      Items[2]=["Last Name", <%= dquote(session( "LastName") ) %>,""];

                      (where dquote() is a little function that you provide that wraps the passed
                      string in double-quotes)

                      --
                      | Grant Wagner <gwagner@agrico reunited.com>

                      * Client-side Javascript and Netscape 4 DOM Reference available at:
                      *


                      * Internet Explorer DOM Reference available at:
                      *
                      Gain technical skills through documentation and training, earn certifications and connect with the community


                      * Netscape 6/7 DOM Reference available at:
                      * http://www.mozilla.org/docs/dom/domref/
                      * Tips for upgrading JavaScript for Netscape 7 / Mozilla
                      * http://www.mozilla.org/docs/web-deve...upgrade_2.html


                      Comment

                      • Jeff North

                        #12
                        Re: Using ASP Variables

                        On Wed, 5 Nov 2003 08:50:38 -0600, in comp.lang.javas cript "Mike"
                        <mbergerREMOVET HIS@skypoint.co m> wrote:
                        [color=blue]
                        >| YES, it will work, and it DOES work....[/color]

                        Sorry, I should've replied to Graig L posting.
                        But my point still stands. You can not use client-side javascript to
                        read data directly from a database.
                        [color=blue]
                        >| "Jeff North" <jnorth@yourpan tsbigpond.net.a u> wrote in message
                        >| news:bg8hqv8mfn fj0au3rhj1t1h8g 1qaf25ucr@4ax.c om...
                        >| > On Tue, 4 Nov 2003 16:04:04 -0600, in comp.lang.javas cript "Mike"
                        >| > <mbergerREMOVET HIS@skypoint.co m> wrote:
                        >| >
                        >| > >| Here is my exact code. This page receives a URL as the following
                        >| > >| "NewPage.asp?TB LS=AttMarket&TB LS=ConfComment"
                        >| > >|
                        >| > >| In ASP, a reference to Request("TBLS") will return the string
                        >| > >| "AttMarket,Conf Comment"
                        >| > >|
                        >| > >| I take that info and save it into a JavaScript array that I can access
                        >| > >| throughout the page on the client side...
                        >| > >| <preliminary HTML stuff>
                        >| > >| <body onload="Loaded( )">
                        >| > >| <%
                        >| > >|
                        >| > >| '-- A bunch of code that means nothing as far as your question goes...
                        >| > >|
                        >| > >| '-- Throw out some JavaScript make it easy to get to the Request
                        >| > >| parameters.
                        >| > >| Response.Write "<script Language=" & chr(34) & "JavaScript " & chr(34)
                        >| & ">"
                        >| > >| Response.Write "numTables= " & Request("TBLS") .Count & ";"
                        >| > >| Response.Write "allTables = new Array(" & (Request("TBLS" ).Count - 1)
                        >| &
                        >| > >| ");"
                        >| > >| For i = 1 to Request("TBLS") .Count
                        >| > >| Response.Write "allTables[" & (i - 1) & "] = " & chr(34) &
                        >| > >| Request("TBLS") (i) & chr(34) & ";"
                        >| > >| Next
                        >| > >| Response.Write "</script>"
                        >| > >|
                        >| > >| '-- More code that means nothing
                        >| > >|
                        >| > >| %>
                        >| > >| </body>
                        >| >
                        >| > You are trying to get the javascript to read from the database. This
                        >| > will not work. You need to do this server-side.
                        >| >
                        >| > Have a look at
                        >| > http://www.asp101.com/samples/viewas...db%5Fdsn%2Easp
                        >| >
                        >| >
                        >| > ---------------------------------------------------------------
                        >| > jnorth@yourpant sbigpond.net.au : Remove your pants to reply
                        >| > ---------------------------------------------------------------
                        >|[/color]

                        ---------------------------------------------------------------
                        jnorth@yourpant sbigpond.net.au : Remove your pants to reply
                        ---------------------------------------------------------------

                        Comment

                        • Craig L

                          #13
                          Re: Using ASP Variables

                          Hey Gang:
                          I'll try what Jeff said to do as soon as I get a chance - probably this
                          afternoon. Will let you know and post the working code for others.

                          Craig

                          "Jeff North" <jnorth@yourpan tsbigpond.net.a u> wrote in message
                          news:24viqvgr5c 0rtulqle6gj3qkk pec8ddmd0@4ax.c om...[color=blue]
                          > On Wed, 5 Nov 2003 08:50:38 -0600, in comp.lang.javas cript "Mike"
                          > <mbergerREMOVET HIS@skypoint.co m> wrote:
                          >[color=green]
                          > >| YES, it will work, and it DOES work....[/color]
                          >
                          > Sorry, I should've replied to Graig L posting.
                          > But my point still stands. You can not use client-side javascript to
                          > read data directly from a database.
                          >[color=green]
                          > >| "Jeff North" <jnorth@yourpan tsbigpond.net.a u> wrote in message
                          > >| news:bg8hqv8mfn fj0au3rhj1t1h8g 1qaf25ucr@4ax.c om...
                          > >| > On Tue, 4 Nov 2003 16:04:04 -0600, in comp.lang.javas cript "Mike"
                          > >| > <mbergerREMOVET HIS@skypoint.co m> wrote:
                          > >| >
                          > >| > >| Here is my exact code. This page receives a URL as the following
                          > >| > >| "NewPage.asp?TB LS=AttMarket&TB LS=ConfComment"
                          > >| > >|
                          > >| > >| In ASP, a reference to Request("TBLS") will return the string
                          > >| > >| "AttMarket,Conf Comment"
                          > >| > >|
                          > >| > >| I take that info and save it into a JavaScript array that I can[/color][/color]
                          access[color=blue][color=green]
                          > >| > >| throughout the page on the client side...
                          > >| > >| <preliminary HTML stuff>
                          > >| > >| <body onload="Loaded( )">
                          > >| > >| <%
                          > >| > >|
                          > >| > >| '-- A bunch of code that means nothing as far as your question[/color][/color]
                          goes...[color=blue][color=green]
                          > >| > >|
                          > >| > >| '-- Throw out some JavaScript make it easy to get to the Request
                          > >| > >| parameters.
                          > >| > >| Response.Write "<script Language=" & chr(34) & "JavaScript " &[/color][/color]
                          chr(34)[color=blue][color=green]
                          > >| & ">"
                          > >| > >| Response.Write "numTables= " & Request("TBLS") .Count & ";"
                          > >| > >| Response.Write "allTables = new Array(" &[/color][/color]
                          (Request("TBLS" ).Count - 1)[color=blue][color=green]
                          > >| &
                          > >| > >| ");"
                          > >| > >| For i = 1 to Request("TBLS") .Count
                          > >| > >| Response.Write "allTables[" & (i - 1) & "] = " & chr(34) &
                          > >| > >| Request("TBLS") (i) & chr(34) & ";"
                          > >| > >| Next
                          > >| > >| Response.Write "</script>"
                          > >| > >|
                          > >| > >| '-- More code that means nothing
                          > >| > >|
                          > >| > >| %>
                          > >| > >| </body>
                          > >| >
                          > >| > You are trying to get the javascript to read from the database. This
                          > >| > will not work. You need to do this server-side.
                          > >| >
                          > >| > Have a look at
                          > >| > http://www.asp101.com/samples/viewas...db%5Fdsn%2Easp
                          > >| >
                          > >| >
                          > >| > ---------------------------------------------------------------
                          > >| > jnorth@yourpant sbigpond.net.au : Remove your pants to reply
                          > >| > ---------------------------------------------------------------
                          > >|[/color]
                          >
                          > ---------------------------------------------------------------
                          > jnorth@yourpant sbigpond.net.au : Remove your pants to reply
                          > ---------------------------------------------------------------[/color]


                          Comment

                          • Craig L

                            #14
                            Re: Using ASP Variables

                            I think I can get this to a simplier problem now that I have played with it.
                            Here is what is happening. This code works for what I'm trying to do:

                            <SCRIPT language=JavaSc ript>

                            var strFirstName="D on"

                            var strLastName="Ro se"

                            </SCRIPT>

                            <SCRIPT>

                            Items[0]=[strFirstName, "", ""];

                            Items[1]=[strLastName, "", ""];

                            </SCRIPT>

                            This code getting ASP to write the javascript equivalent like this, doesn't
                            work:

                            <%

                            response.write "<SCRIPT Language=" & chr(34) & "JavaScript " & chr(34)

                            response.write "var strFirstName=" & chr(34) & "Don" & chr(34)

                            response.write "var strLastName=" & chr(34) & "Rose" & chr(34)

                            response.write "</SCRIPT>"

                            %>

                            <SCRIPT>

                            Items[0]=[strFirstName, "", ""];

                            Items[1]=[strLastName, "", ""];

                            </SCRIPT>

                            If I can just get this right, I can get the rest working on my own.

                            Craig

                            "Grant Wagner" <gwagner@agrico reunited.com> wrote in message
                            news:3FA94542.F 85E0C3B@agricor eunited.com...
                            [color=blue]
                            > Craig L wrote:
                            >[color=green]
                            > > I use ASP to obtain data from a database and I have a piece of[/color][/color]
                            javascript[color=blue][color=green]
                            > > code I use on my website. I want to use the database variables in my
                            > > javascript. I'm not very familiar with javascript, but here is some info
                            > > similar to what I'm trying to do.
                            > >
                            > > <%
                            > > strFirstName=se ssion("FirstNam e") ASP code
                            > > strLastName=ses sion("LastName" )
                            > > %>
                            > >
                            > > The javascript code I want to use the variables in.
                            > > Items[1]=["First Name", strFirstName,""]
                            > > Items[2]=["Last Name", strLastName,""]
                            > >
                            > > Please help or point me to a website with this solution. Thanks much for
                            > > your help.
                            > >
                            > > Craig
                            > >
                            > > w1zard@hotSPAMm ail.com (remove SPAM before sending)[/color]
                            >
                            > Trivial:
                            >
                            > Items[1]=["First Name", "<%= session('FirstN ame') %>",""];
                            > Items[2]=["Last Name", "<%= session('LastNa me') %>",""];
                            >
                            > If <%= %> doesn't evaluate properly inside double-quotes (I'm not sure how
                            > ASP deals with this), then you could use something like:
                            >
                            > Items[1]=["First Name", <%= dquote(session( "FirstName" )) %>,""];
                            > Items[2]=["Last Name", <%= dquote(session( "LastName") ) %>,""];
                            >
                            > (where dquote() is a little function that you provide that wraps the[/color]
                            passed[color=blue]
                            > string in double-quotes)
                            >
                            > --
                            > | Grant Wagner <gwagner@agrico reunited.com>
                            >
                            > * Client-side Javascript and Netscape 4 DOM Reference available at:
                            > *
                            >[/color]
                            http://devedge.netscape.com/library/...ce/frames.html[color=blue]
                            >
                            > * Internet Explorer DOM Reference available at:
                            > *
                            >[/color]
                            http://msdn.microsoft.com/workshop/a...ence_entry.asp[color=blue]
                            >
                            > * Netscape 6/7 DOM Reference available at:
                            > * http://www.mozilla.org/docs/dom/domref/
                            > * Tips for upgrading JavaScript for Netscape 7 / Mozilla
                            > * http://www.mozilla.org/docs/web-deve...upgrade_2.html
                            >
                            >[/color]


                            Comment

                            • Craig L

                              #15
                              Re: Using ASP Variables

                              Visit the posting "ANS: Using ASP Variables" posted on 11/09/03 for the
                              solution to this issue.

                              Craig

                              w1zard10@hotSPA Mmail.com (remove SPAM before emailing).


                              "Craig L" <w1zard10@hotSP AMmail.com> wrote in message
                              news:w8idnfGM2J ozaTqiRVn-tw@comcast.com. ..[color=blue]
                              > I use ASP to obtain data from a database and I have a piece of javascript
                              > code I use on my website. I want to use the database variables in my
                              > javascript. I'm not very familiar with javascript, but here is some info
                              > similar to what I'm trying to do.
                              >
                              > <%
                              > strFirstName=se ssion("FirstNam e") ASP code
                              > strLastName=ses sion("LastName" )
                              > %>
                              >
                              > The javascript code I want to use the variables in.
                              > Items[1]=["First Name", strFirstName,""]
                              > Items[2]=["Last Name", strLastName,""]
                              >
                              > Please help or point me to a website with this solution. Thanks much for
                              > your help.
                              >
                              > Craig
                              >
                              > w1zard@hotSPAMm ail.com (remove SPAM before sending)
                              >
                              >[/color]


                              Comment

                              Working...