simonB2007
Programmer
Looking for help with a scrip that works on IE, but suffers in Firefox.
Running all locally for now.
Each run of script makes multiple calls to "f_request" (consecutively)
Always calls to same path, at this stage only 1 parameter in the send string changes each time.
In Mozilla:
On first cylce of code, 2 requests are made succesfully.
Upon user interaction, code runs again to make a 3rd call ...but hangs completely upon "req.open"
If i was to give 'feeling' ... its as though the request hasn't terminated properly from the previous call !?
Have tried several setRequestHeader things to prevent caching etc etc ... none to success (included in code below).
Reference Material Below...
(1) Javascript code
(2) .asp script generating responses
(3) Sample call strings (used in req.send(send)) and responses
Hope someone can help as i'm getting hopelessly lost !!
Many thanks
Simon
======================= page.htm
function f_request(s_inData, s_path){
// path to send request
fullPath = s_saveRoot + s_path;
// create request object
try {req = new ActiveXObject("Msxml2.XMLHTTP");}
catch (e) {
try {req = new ActiveXObject("Microsoft.XMLHTTP");}
catch (e) {req = false;}
}
if (!req && typeof req !='undefined') {
try {req = new XMLHttpRequest();}
catch (e) {req=false;}
}
if (!req && window.createRequest) {
try {req = window.createRequest();}
catch (e) {req=false;}
}
req.open("POST",fullPath,true); // **hangs here
req.setRequestHeader("Cache-Control", "no-cache");
//req.setRequestHeader("Connection", "close");
req.setRequestHeader("Content-Type", "application/x-
req.onreadystatechange=sendDone;
req.send(s_inData);
}
======================= dataProvider.asp
<%
Response.ExpiresAbsolute = #2000-01-01#
Response.AddHeader "pragma", "no-cache"
Response.AddHeader "cache-control", "private, no-cache, must-revalidate"
i_usr = request.form("usr")
s_cString = request.form("c")
s_filters= request.form("f")
///// o_cmd is user def function
Set o_cmd = new c_cmd
s_spName = "web_treeFeed_sp"
i_headers =0
o_cmd.CommandTextType s_spName , &H0004
o_cmd.addParamCrit "Usr", adInteger, adparaminput, 4, i_usr
o_cmd.addParamCrit "cString", adVarchar, adparaminput, 12, s_cString
o_cmd.addParamCrit "filters", advarchar, adparaminput, 12, s_filters
o_cmd.setHeaders(i_headers)
s_result = o_cmd.GetData()
Set o_cmd = Nothing
/////
Response.ContentType = "text/xml"
s_out = "<ReturnValue>" &_
s_result &_
"</ReturnValue>"
Response.write s_out
%>
=========================
call send strings ....
inData = usr=1&c=2,1,3,4,5&f=-1
inData = usr=1&c=2,1,3,4,5&f=-1,1
inData = usr=1&c=2,1,3,4,5&f=-1,1,1
scripted responses.....
<ReturnValue>0,1,Art#</ReturnValue>
<ReturnValue>0,1,Ceramic#0,2,Paint-Pencil#</ReturnValue>
<ReturnValue>0,4,Stoneware#</ReturnValue>
Running all locally for now.
Each run of script makes multiple calls to "f_request" (consecutively)
Always calls to same path, at this stage only 1 parameter in the send string changes each time.
In Mozilla:
On first cylce of code, 2 requests are made succesfully.
Upon user interaction, code runs again to make a 3rd call ...but hangs completely upon "req.open"
If i was to give 'feeling' ... its as though the request hasn't terminated properly from the previous call !?
Have tried several setRequestHeader things to prevent caching etc etc ... none to success (included in code below).
Reference Material Below...
(1) Javascript code
(2) .asp script generating responses
(3) Sample call strings (used in req.send(send)) and responses
Hope someone can help as i'm getting hopelessly lost !!
Many thanks
Simon
======================= page.htm
function f_request(s_inData, s_path){
// path to send request
fullPath = s_saveRoot + s_path;
// create request object
try {req = new ActiveXObject("Msxml2.XMLHTTP");}
catch (e) {
try {req = new ActiveXObject("Microsoft.XMLHTTP");}
catch (e) {req = false;}
}
if (!req && typeof req !='undefined') {
try {req = new XMLHttpRequest();}
catch (e) {req=false;}
}
if (!req && window.createRequest) {
try {req = window.createRequest();}
catch (e) {req=false;}
}
req.open("POST",fullPath,true); // **hangs here
req.setRequestHeader("Cache-Control", "no-cache");
//req.setRequestHeader("Connection", "close");
req.setRequestHeader("Content-Type", "application/x-
req.onreadystatechange=sendDone;
req.send(s_inData);
}
======================= dataProvider.asp
<%
Response.ExpiresAbsolute = #2000-01-01#
Response.AddHeader "pragma", "no-cache"
Response.AddHeader "cache-control", "private, no-cache, must-revalidate"
i_usr = request.form("usr")
s_cString = request.form("c")
s_filters= request.form("f")
///// o_cmd is user def function
Set o_cmd = new c_cmd
s_spName = "web_treeFeed_sp"
i_headers =0
o_cmd.CommandTextType s_spName , &H0004
o_cmd.addParamCrit "Usr", adInteger, adparaminput, 4, i_usr
o_cmd.addParamCrit "cString", adVarchar, adparaminput, 12, s_cString
o_cmd.addParamCrit "filters", advarchar, adparaminput, 12, s_filters
o_cmd.setHeaders(i_headers)
s_result = o_cmd.GetData()
Set o_cmd = Nothing
/////
Response.ContentType = "text/xml"
s_out = "<ReturnValue>" &_
s_result &_
"</ReturnValue>"
Response.write s_out
%>
=========================
call send strings ....
inData = usr=1&c=2,1,3,4,5&f=-1
inData = usr=1&c=2,1,3,4,5&f=-1,1
inData = usr=1&c=2,1,3,4,5&f=-1,1,1
scripted responses.....
<ReturnValue>0,1,Art#</ReturnValue>
<ReturnValue>0,1,Ceramic#0,2,Paint-Pencil#</ReturnValue>
<ReturnValue>0,4,Stoneware#</ReturnValue>