Expand|Select|Wrap|Line Numbers
- #...XMLHttpRequest Object has been created outside the loop e.t.c.
- for(var cnt=0; cnt < 5; cnt++)
- {
- #...some code here
- ajaxObj.open("GET", url, true);
- ajaxObj.onreadystatechange = dispValue; # Line 200: Problem Point
- #Another option I tried - function(){dispValue();}; #Line 210
- ajaxObj.send(null);
- function dispValue()
- {
- if(ajaxObj.readyState == 4)
- {
- if(ajaxObj.status == 200)
- {
- var resp = ajaxObj.responseText;
- #resp += resp; #Line 250
- alert(resp);
- }
- }
- }
2. Is my alternative on line 210 allowed?
3. The second problem is on line 250, where I want to add the responseText repeatedly in the loop. The responses are numbers e.g. 45, 72, 23.
Please ignore the wrong ordering of line numbers - it was just for clarity.
Development Platform
- Windows XP Home Edition
- Firefox/ Firebug, IE and Opera browsers
- PHP, MySQL