#1
  1. No Profile Picture
    Contributing User
    ASP Adventurer (500 - 999 posts)

    Join Date
    Sep 2006
    Location
    California
    Posts
    766
    Rep Power
    26

    How to call VBScript function from Javascript Function?


    How can I call the VBScript function:

    GetSubordinates(managerID) from within the Javascript function. Thanks.

    Code:
    <script language="Javascript">
    
    Function callVBScript{
    	GetSubordinates(managerID);
    }
    </script>
    Code:
    <a href="#" class="a_style" onClick="callVBScript();"><%=aTopManagers(2, 0)%></a href>
  2. #2
  3. No Profile Picture
    Contributing User
    ASP Adventurer (500 - 999 posts)

    Join Date
    Sep 2005
    Posts
    744
    Rep Power
    55
    VBScript = serverside
    Javascript = clientside

    The only way to do something like this is to generate all necessary data in your vbscript and then pass it to the javascript function.


    If you want to go the other way, then the javascript will have to reload the page (in order to execute server side commands) with some querystring parameter that tells the vbscript to execute its function.
  4. #3
  5. No Profile Picture
    Contributing User
    ASP Adventurer (500 - 999 posts)

    Join Date
    Sep 2006
    Location
    California
    Posts
    766
    Rep Power
    26
    So can't I call VBScript function from Javascript. VBScript has the array. I just want to drill down by calling the VBScript function.

    Thanks.
  6. #4
  7. No Profile Picture
    Contributing User
    ASP Adventurer (500 - 999 posts)

    Join Date
    Sep 2005
    Posts
    744
    Rep Power
    55
    NO.

    VBSCRIPT=SERVER
    JAVASCRIPT=CLIENT

    If you are unfamiliar with the difference or you are not clear on what this actually means, i suggest you do some research.

    Just because they are on the same page does not make them compatable. They work at two seperate times.

    I have given you the solution to your problem. Use either/or depending on which way you need to go.

Similar Threads

  1. VBscript call to an Access Module Function
    By gmh in forum Visual Basic Programming
    Replies: 1
    Last Post: August 25th, 2005, 11:22 PM
  2. Call VBScript Function from JavaScript
    By Steve Schofield in forum ASP Development
    Replies: 3
    Last Post: October 22nd, 2001, 10:16 AM
  3. How to call a client side javascript function from ASP
    By Steve Schofield in forum ASP Development
    Replies: 1
    Last Post: August 30th, 2001, 03:09 PM
  4. Call ASP function from Javascript
    By Steve Schofield in forum ASP Development
    Replies: 1
    Last Post: March 21st, 2001, 09:25 PM
  5. Call Javascript function from ASP
    By Steve Schofield in forum ASP Development
    Replies: 2
    Last Post: February 27th, 2001, 10:47 AM

IMN logo majestic logo threadwatch logo seochat tools logo