PDA

View Full Version : Remote Scripting


Spudhead
03-14-2003, 12:19 PM
Hi,

Thought I'd have a look at this Remote Scripting thingy. Installed it in wwwroot, now I've got a _ScriptLibrary folder in there, all the usual files etc.

I'm following the tutorial that's up at DevGuru (http://www.devguru.com/Features/tutorials/RemoteScripting/RemoteScripting1.html), I've literally copied & pasted the code for the two pages that make up the first example, and now have 'client_test.html' and 'rev.asp' sat in my wwwroot.

I get an error.

client_test.html loads fine, the applet is initialised, but when I hit the "Reverse" button and enter a string in the prompt, I get:

Failed to create ASP object for : rev.asp

Being completely clueless about what I'm doing, I have no idea what that means or how to fix it. My OS is Win XP Pro Ver 5.01.2600 (SP1), running IIS 5.1, not sure what ADO version (anyone know how to find out?) and my mouse is a kind of greyish colour.

client_test.html:

<html>
<head>
<title> Remote Scripting Example </title>
<script type="text/javascript" src="_ScriptLibrary/RS.HTM"></script>
<script type="text/javascript">
function reverseString()
{
var strTest = prompt("Enter String To Reverse:");
var objRS = RSGetASPObject("rev.asp");
var objResult = objRS.revStr(strTest);

alert(objResult.return_value);
}
</script>
</head>
<body>
<script type="text/javascript">
RSEnableRemoteScripting("/_ScriptLibrary");
</script>
<form name="frmTest">
<input type="button" onClick="reverseString()" value="Reverse String >>">
</form>
</body>
</html>


rev.asp:

<!--#INCLUDE FILE="_ScriptLibrary/RS.ASP"-->
<% RSDispatch %>
<script type="text/javascript" runat="server">
var public_description = new MainMethod();
function MainMethod()
{
this.revStr = Function('strString','return reverse(strString)');
}
</script>
<script type="text/VBScript" runat="server">
function reverse(strString)
reverse = strReverse(strString)
end function
</script>