Run server-side vbscript subroutine from client-side javascript

Discussion in 'Javascript' started by victor.buga@gmail.com, Jan 19, 2007.

  1. Guest

    Hi,

    Could somebody please guide me how to retrieve the subroutine that's on
    the server, and using javascript tell the server to invoke that
    subroutine.
    Everything is in the same ".asp" page.

    =============================================================================
    <%

    Sub DoSomethingOnServer
    'do something on server
    End Sub

    %>

    <html>
    <head>

    <script language=javascript>
    function CheckForm(myForm, action)
    {
    DoSomethingOnServer
    }
    </script>

    </head>

    </html>

    ==============================================================================

    Is this possible at all ?
    If so, how? Ive read some material on XmlHttpObject but nowhere it
    shows how to invoke this method, especially if you have to mix
    Javascript and VBScript.

    Responses are greatly appreciated.

    Thanks,
    Victor.
     
    , Jan 19, 2007
    #1
    1. Advertising

  2. Randy Webb Guest

    said the following on 1/19/2007 3:50 PM:
    > Hi,
    >
    > Could somebody please guide me how to retrieve the subroutine that's on
    > the server, and using javascript tell the server to invoke that
    > subroutine.
    > Everything is in the same ".asp" page.
    >
    > =============================================================================
    > <%
    >
    > Sub DoSomethingOnServer
    > 'do something on server
    > End Sub
    >
    > %>
    >
    > <html>
    > <head>
    >
    > <script language=javascript>
    > function CheckForm(myForm, action)
    > {
    > DoSomethingOnServer
    > }
    > </script>
    >
    > </head>
    >
    > </html>
    >
    > ==============================================================================
    >
    > Is this possible at all ?
    > If so, how? Ive read some material on XmlHttpObject but nowhere it
    > shows how to invoke this method, especially if you have to mix
    > Javascript and VBScript.
    >
    > Responses are greatly appreciated.


    You could try reading the group FAQ:

    <URL: http://jibbering.com/faq/index.html#FAQ4_34>

    And it doesn't matter what language is on the server nor the client, the
    concept is the same.

    --
    Randy
    Chance Favors The Prepared Mind
    comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
    Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
     
    Randy Webb, Jan 19, 2007
    #2
    1. Advertising

  3. Guest

    Can you provide a more specific example ?
    The link you provided, shows how to get data from the server. I don't
    actually need to retrieve data, i need to tell the server with
    javascript to run a method (subroutine). The sub actually uses some C++
    interop classes, but that's not part of my scope.

    <%
    Set logHelper = Server.CreateObject("CBI.Engines.ExceptionHelper")
    logHelper.ReportSystemChange Request.ServerVariables("logon_user"),
    CBI_CHANGE_UPDATE_USER, "change", "97051009", 1000, 43, "site",
    "resource"
    %>

    All I need is to invoke this ReportSystemChange sub, but through
    javascript.


    Many thanks,

    Victor.



    Randy Webb wrote:
    > said the following on 1/19/2007 3:50 PM:
    > > Hi,
    > >
    > > Could somebody please guide me how to retrieve the subroutine that's on
    > > the server, and using javascript tell the server to invoke that
    > > subroutine.
    > > Everything is in the same ".asp" page.
    > >
    > > =============================================================================
    > > <%
    > >
    > > Sub DoSomethingOnServer
    > > 'do something on server
    > > End Sub
    > >
    > > %>
    > >
    > > <html>
    > > <head>
    > >
    > > <script language=javascript>
    > > function CheckForm(myForm, action)
    > > {
    > > DoSomethingOnServer
    > > }
    > > </script>
    > >
    > > </head>
    > >
    > > </html>
    > >
    > > ==============================================================================
    > >
    > > Is this possible at all ?
    > > If so, how? Ive read some material on XmlHttpObject but nowhere it
    > > shows how to invoke this method, especially if you have to mix
    > > Javascript and VBScript.
    > >
    > > Responses are greatly appreciated.

    >
    > You could try reading the group FAQ:
    >
    > <URL: http://jibbering.com/faq/index.html#FAQ4_34>
    >
    > And it doesn't matter what language is on the server nor the client, the
    > concept is the same.
    >
    > --
    > Randy
    > Chance Favors The Prepared Mind
    > comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
    > Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
     
    , Jan 22, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Guadala Harry
    Replies:
    4
    Views:
    1,522
    =?Utf-8?B?aGFyaSBwcmFzYWQ=?=
    Jun 15, 2004
  2. Eitan
    Replies:
    2
    Views:
    531
    Eitan
    Jun 4, 2005
  3. alan
    Replies:
    2
    Views:
    6,416
  4. COHENMARVIN
    Replies:
    2
    Views:
    882
    Jason Kester
    Oct 20, 2005
  5. David Shorthouse

    server-side vbscript call with javascript client-side

    David Shorthouse, Feb 2, 2005, in forum: ASP General
    Replies:
    2
    Views:
    359
    Mark Schupp
    Feb 3, 2005
Loading...

Share This Page