Notices

Great community. Great ideas.

Welcome to ASP/Free, a community dedicated to helping beginners and professionals alike in improving their knowledge of Microsoft's development and administration technologies. Sign up today to gain access to the combined insight of tens of thousands of members.

Thread: How to call VBScript function from Javascript Function?

Results 1 to 4 of 4
Share This Thread →
  1. #1
    zwieback89 is offline Contributing User
    Join Date
    Sep 2006
    Location
    California
    Posts
    766
    Rep Power
    25

    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
    zanna5910 is offline Contributing User
    Join Date
    Sep 2005
    Posts
    744
    Rep Power
    54
    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.

  3. #3
    zwieback89 is offline Contributing User
    Join Date
    Sep 2006
    Location
    California
    Posts
    766
    Rep Power
    25
    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.

  4. #4
    zanna5910 is offline Contributing User
    Join Date
    Sep 2005
    Posts
    744
    Rep Power
    54
    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.

Share This Thread →

Become Part of This Conversation

Join NowFor Free!

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

ASP Free Advertisers and Affiliates