xmlhttprequest, firefox hangs on 3rd call

This is a discussion on "xmlhttprequest, firefox hangs on 3rd call" within the JavaScript Forum section. This forum, and the thread "xmlhttprequest, firefox hangs on 3rd call are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Jun 12th, 2007, 15:26
New Member
Join Date: Jun 2007
Location: Cheshire, UK
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
xmlhttprequest, firefox hangs on 3rd call

Looking for help with a scrip that works on IE, but suffers in Firefox.

URL : http://www.outofthebluesolutions.co.uk/tm/t.asp
(opens pop-up debugger)

Each run of script makes calls to "f_request" (consecutively)
Always calls to same path, but varying send strings.

Show Error:
Correct 1st run of code (auto on page load):
xmlhttprequest returns "Art" and adds to the tree.
Correct 2nd run (click '+' next to ART) :
xmlhttprequest re-used and returns 2 more nodes which are added to the tree.
ERROR 3rd run (click '+' next to CERAMIC) :
xmlhttprequest hangs when attempting open() call.

Most mysterious as the req object is .abort() before each call, and the calling path is hard-coded so no change.

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
======================= t.asp
function f_request(s_inData, s_path){
//report bad call
if(!s_inData){debug("***false call");return false}
// if xmlhttprequest object exists, abort ready for re-use
// else create new request object
if(req){
debug("f_request : Aborting & Resusing");
req.abort();
}else{
debug("f_request : Creating New xmlHttpRequest 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;}
}
}

fullPath = "treeIncludes/NDR.asp";
req.open("POST",fullPath,true);
req.setRequestHeader("Cache-Control", "no-cache");
//req.setRequestHeader("Connection", "close");
req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");

req.onreadystatechange=sendDone;
req.send(s_inData);
}



======================= ndr.asp (data provider)

<%
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>
Reply With Quote

Reply

Tags
ajax, firefox, javascript, xmlhttprequest

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
[solved] Don't know what to call it acrikey Webforumz Cafe 3 Mar 24th, 2008 18:45
[SOLVED] XmlHttpRequest not working properly djeyewater JavaScript Forum 3 Jan 31st, 2008 20:33
Problems with XmlHttpRequest Object: readystate won't go past 1 hype JavaScript Forum 1 Jan 13th, 2008 14:18
what do I call this 'some impovement?' geyids Webforumz Cafe 11 Jul 8th, 2007 10:56


All times are GMT. The time now is 10:39.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43