programming-examples/asp/Miscellaneous/Remote Scripting Basics.asp
2019-11-18 14:25:58 +01:00

57 lines
1.1 KiB
Plaintext

<HTML><HEAD><TITLE>remote1.htm</TITLE></HEAD>
<BODY onload="handleRSExecute()">
<script language="JavaScript" src="/learn/test/remote/rs.htm"></script>
<script language="JavaScript">RSEnableRemoteScripting("/learn/test/remote/");</script>
<h2>Simple Remote Scripting Example</h2>
<form name="remote1">
The Test <Input Type="text" name="test" value="none"><br>
<SCRIPT LANGUAGE="javascript">
var serverURL = "remote1.asp";
Function myCallBack(co)
{
// document.write (co.return_value);
remote1.test.value=co.return_value;
}
Function handleRSExecute()
{
var co = RSExecute(serverURL,"Method3");
myCallBack(co);
}
</SCRIPT>
</form>
</HTML>
Our sample remote1.asp looks like this:
<%@ LANGUAGE=VBSCRIPT %>
<% RSDispatch %>
<!--#INCLUDE VIRTUAL="/learn/test/remote/rs.asp"-->
<SCRIPT RUNAT=SERVER Language=javascript>
Function Description()
{
this.Method1 = Method1;
this.Method2 = Method2;
this.Method3 = Method3;
}
public_description = New Description();
Function Method1()
{
return "method1";
}
Function Method2()
{
return "method2";
}
Function Method3()
{
return "method3";
}
</script>