Run server-side vbscript subroutine from client-side javascript

V

victor.buga

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.
 
R

Randy Webb

(e-mail address removed) 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.
 
V

victor.buga

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top