To ensure that the RSProxy.class applet has been fully downloaded and instantiated, place all code that will make calls to
RSExecute or
RSGetAspObject within valid client events, such as button
onClick events or
onMouseOver events.
If the call to
RSExecute or
RSGetAspObject must occur when the Web page is first loaded into the browser, place the code that calls
RSExecute or
RSGetAspObject into the
window object's
onload event.
For example:
<HTML>
<SCRIPT Language="JavaScript" src="_ScriptLibrary/rs.htm"></SCRIPT>
<SCRIPT LANGUAGE="javascript">RSEnableRemoteScripting();</SCRIPT>
<BODY onload=Initialize()>
<H2>Remote Scripting Sample</H2>
<SCRIPT LANGUAGE="javascript">
var strServerURL = "rs_server.asp";
function Initialize()
{
var objRemote = RSExecute(strServerURL, "ServerMethod");
}
</SCRIPT>
</BODY>
</HTML>