Are you using "synchronous" or "asynchronous" XMLHttp? Turn on the
Asynchronous option and your script won't hang. Otherwise, this is not
a JavaScript issue but an HTTP issue and the problem lies between your
server and your connection. I take it you have some sort of session
timeout and the connection keeps getting reset. Without seeing any of
your code to know what's going on here, I'd take a stab at it and say
"Unknown name" is probably an HTTP error that you're running into when
the request times out.
I'm using a synchronous http request, I've attached my function below.
I can't use asynchronous because the flow needs to be strictly
controlled due to the nature of the application. The catch() block is
triggered after the 5 minute freeze. The http request completes
successfully after 5 minutes.
This problem hasn't occured since iisreset was run last night. If this
problem comes back I will update this thread.
Thanks
CallServer : function( sAction, sSendMethod)
{
var sReturn = "";
var oEngine;// = this.Request.Engine;
var sParameterString = "";
var sPostString = null;
try
{
oEngine = new ActiveXObject("Microsoft.XMLHTTP");//ELMS TEST
if( oEngine != null)
{
if( oEngine.readyState == 4 || oEngine.readyState == 0)
{
var sUrl = "ServerInteract.aspx?token=" + Page.Token + "&dothis=" +
sAction;
if( arguments != null)
{
for( nParameterIndex = 2; nParameterIndex < arguments.length;
nParameterIndex ++)
{
sParameterString += arguments[nParameterIndex];
if( nParameterIndex < arguments.length - 1)
{
sParameterString += "&";
}
}
}
if( sSendMethod.toLowerCase() == "post")
{
sPostString = sParameterString;
}
else
{
sUrl += "&" + sParameterString;
}
sUrl += "&millis=" + new Date().getTime();
oEngine.open( sSendMethod, sUrl, false);
oEngine.setRequestHeader( 'Content-Type',
'application/x-www-form-urlencoded');
System.Log( "ServerInteract.CallServer() : Sending '" + sPostString
+ "' with action '" + sAction + "' to " + sUrl);
oEngine.send( sPostString);
sReturn = oEngine.ResponseText;
System.Log( "ServerInteract.CallServer() : Done : \r\n" + sReturn);
if( sReturn.indexOf( "exception:") == 0)
{
PageRendering.HandleError( sReturn);
sReturn = "";
}
}
else
{
System.Log( "ServerInteract.CallServer() : Cannot Send() because
oEngine.readyState = " = oEngine.readyState);
}
}
else
{
System.Log( "ServerInteract.CallServer() : Cannot Send() because
oEngine is null");
sReturn = "";
PageRendering.HandleError( "XmlHttpRequest Fail 1");
}
}
catch( e)
{
sReturn = "";
System.Log( "ServerInteract.CallServer() : Cannot Send() because of
exception '" + e.message + "");
PageRendering.HandleError( "XmlHttpRequest Fail 2: " + e.message);
}
return sReturn;
},