Javascript to read asp variable

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

    Javascript to read asp variable

    Hi All,

    Is it possible to read any ASP variable from a javascript file (.js) ?


    Thanks
    Prabhat


  • Evertjan.

    #2
    Re: Javascript to read asp variable

    Prabhat wrote on 31 okt 2005 in microsoft.publi c.inetserver.as p.general:
    [color=blue]
    > Is it possible to read any ASP variable from a javascript file (.js) ?
    >[/color]

    Call it an .asp file and use it as a .js. file.

    --
    Evertjan.
    The Netherlands.
    (Replace all crosses with dots in my emailaddress)

    Comment

    • Prabhat

      #3
      Re: Javascript to read asp variable

      "Evertjan." <exjxw.hannivoo rt@interxnl.net > wrote in message
      news:Xns97007F9 A424BDeejj99@19 4.109.133.242.. .[color=blue]
      >
      > Call it an .asp file and use it as a .js. file.
      >
      > --
      > Evertjan.
      > The Netherlands.
      > (Replace all crosses with dots in my emailaddress)[/color]

      Hi,

      Actually I call the .js file from the home page like:
      <script type='text/javascript' src='Scripts/MenuScript.js'> </script>

      So How can I proceed. I have the menu Links in the .js file (some of the
      links are also points to other web sites). So I am updating the web site so
      that where ever I have used the specific link (say: www.abc.com) that should
      now read a ASP variable dynamically. I have 2 lines in the above .js file
      and I want that 2 lines to read the same ASP variable. Hope you are able to
      understand.

      Thanks
      Prabhat


      Comment

      • Evertjan.

        #4
        Re: Javascript to read asp variable

        Prabhat wrote on 31 okt 2005 in microsoft.publi c.inetserver.as p.general:[color=blue]
        > "Evertjan." <exjxw.hannivoo rt@interxnl.net > wrote in message[color=green]
        >>
        >> Call it an .asp file and use it as a .js. file.[/color]
        >
        > Actually I call the .js file from the home page like:
        > <script type='text/javascript' src='Scripts/MenuScript.js'> </script>[/color]

        Don't.

        If you want to use lines in that file like this:

        var blahClientside = '<% =blahServerside VBSorJS %>';

        use:

        <script type='text/javascript' src='Scripts/MenuScript.asp' ></script>




        --
        Evertjan.
        The Netherlands.
        (Replace all crosses with dots in my emailaddress)

        Comment

        • Prabhat

          #5
          Re: Javascript to read asp variable

          "Evertjan." <exjxw.hannivoo rt@interxnl.net > wrote in message
          news:Xns9700873 53790Beejj99@19 4.109.133.242.. .[color=blue]
          > Prabhat wrote on 31 okt 2005 in microsoft.publi c.inetserver.as p.general:[color=green]
          > > "Evertjan." <exjxw.hannivoo rt@interxnl.net > wrote in message[color=darkred]
          > >>
          > >> Call it an .asp file and use it as a .js. file.[/color]
          > >
          > > Actually I call the .js file from the home page like:
          > > <script type='text/javascript' src='Scripts/MenuScript.js'> </script>[/color]
          >
          > Don't.
          >
          > If you want to use lines in that file like this:
          >
          > var blahClientside = '<% =blahServerside VBSorJS %>';
          >
          > use:
          >
          > <script type='text/javascript' src='Scripts/MenuScript.asp' ></script>
          >
          >
          >
          >
          > --
          > Evertjan.
          > The Netherlands.
          > (Replace all crosses with dots in my emailaddress)[/color]

          Hi

          You want me to change the "MenuScript .js" file to "MenuScript.asp " and
          Include the line I wanted to use in javascript file?

          and then:
          I will use the below line in my home page ("default.htm") ?
          <script type='text/javascript' src='Scripts/MenuScript.asp' ></script>

          But if so will the "script type='text/javascript' " still work ?

          Thanks
          Prabhat


          Comment

          • Evertjan.

            #6
            Re: Javascript to read asp variable

            Prabhat wrote on 31 okt 2005 in microsoft.publi c.inetserver.as p.general:[color=blue]
            > "Evertjan." <exjxw.hannivoo rt@interxnl.net > wrote in message[color=green]
            >> Prabhat wrote on 31 okt 2005 in[color=darkred]
            >> > "Evertjan." <exjxw.hannivoo rt@interxnl.net > wrote in message
            >> >>
            >> >> Call it an .asp file and use it as a .js. file.
            >> >
            >> > Actually I call the .js file from the home page like:
            >> > <script type='text/javascript' src='Scripts/MenuScript.js'> </script>[/color]
            >>
            >> Don't.
            >>
            >> If you want to use lines in that file like this:
            >> var blahClientside = '<% =blahServerside VBSorJS %>';
            >> use:
            >> <script type='text/javascript' src='Scripts/MenuScript.asp' ></script>[/color]
            >
            > You want me to change the "MenuScript .js" file to "MenuScript.asp " and
            > Include the line I wanted to use in javascript file?
            >
            > and then:
            > I will use the below line in my home page ("default.htm") ?
            > <script type='text/javascript' src='Scripts/MenuScript.asp' ></script>
            >
            > But if so will the "script type='text/javascript' " still work ?[/color]

            That is what I am trying to tell you,
            but better than believing me, try it out.]

            Using a session variable:
            var blahClientside = '<% =session("blahS erversideVBSorJ S") %>';

            Or the server time:
            var timeOnServer = '<% =now %>';


            btw:
            About the same goes for:
            <img src='myJpg.asp' >
            [as long as you send an image stream with the right disposition header]


            --
            Evertjan.
            The Netherlands.
            (Replace all crosses with dots in my emailaddress)

            Comment

            Working...