Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Porthcawl, Mid Glamorgan, Wales
    Posts
    107
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Passing parameters between VBScript and JScript

    I use VBScript in an ASP file to read and write from an Access database. In the same file I use a Javascript popup menu system. I want to be able to read a small string from the database and pass it to the Javascript to be included in a generated path. Any ideas how I can accomplish this?

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Passing parameters between VBScript and JScript

    If you are writing the JavaScript into the page itself, and not using an include, you can use regular ASP tags and/or Reponse.Write to insert the value into your JavaScript code before serving the page. I haven't tested this, but this is the idea:

    <SCRIPT Language="JavaScript">
    var path = "<%=strPath%>"
    etc.
    </SCRIPT>

    or perhaps

    <%
    Response.Write "<SCRIPT Language=""JavaScript"">" & VbCrLf
    Response.Write "var path = """ & strPath & """"
    etc.
    %>

  3. #3
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Porthcawl, Mid Glamorgan, Wales
    Posts
    107
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Passing parameters between VBScript and JScript

    Thanks, I sort of worked it out for myself using the Response.Write method.

Posting Permissions

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