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.
|
|
|
|
|
![]() |
||
xmlhttprequest, firefox hangs on 3rd call
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
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> |
|
|
![]() |
| Tags |
| ajax, firefox, javascript, xmlhttprequest |
| Thread Tools | |
|
|
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 |