473,326 Members | 2,113 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

ajax loading problem

I have used an ajax file furnaces.html with code as below.The file furnacedata.php is used to generate XML dynamically and this appears to working well. timerID is used to reload the XML data at intervals of 1000ms. This code appears to be working in some PCs and not in others. It is not giving a reliable output. can anybody help?

Code:
[HTML]<head>
<script language="JavaScript" type="text/JavaScript">
[/HTML]
Expand|Select|Wrap|Line Numbers
  1. function getfurnacedata()
  2. {
  3. var XMLHttpRequestObject = false;
  4.  
  5.      if (window.XMLHttpRequest) {
  6.        XMLHttpRequestObject = new XMLHttpRequest();
  7.        XMLHttpRequestObject.overrideMimeType("text/xml");
  8.      } else if (window.ActiveXObject) {
  9.        XMLHttpRequestObject = new
  10.          ActiveXObject("Microsoft.XMLHTTP");
  11.      }
  12.  
  13.   if(XMLHttpRequestObject) {
  14.     XMLHttpRequestObject.open("GET", "furnacedata.php");
  15.     XMLHttpRequestObject.onreadystatechange = function()
  16.     {
  17.       if (XMLHttpRequestObject.readyState == 4 &&
  18.         XMLHttpRequestObject.status == 200) {
  19.       var xmlDocument = XMLHttpRequestObject.responseXML;
  20.         var1data1 = xmlDocument.getElementsByTagName("var1data1");
  21.         var1data2 = xmlDocument.getElementsByTagName("var1data2");
  22.     var1data3 = xmlDocument.getElementsByTagName("var1data3");
  23.     var1data4 = xmlDocument.getElementsByTagName("var1data4");
  24.              document.getElementById("ID1").innerHTML=var1data1[0].firstChild.nodeValue;
  25.     document.getElementById("ID2").innerHTML=var1data2[0].firstChild.nodeValue;
  26.     document.getElementById("ID3").innerHTML=var1data3[0].firstChild.nodeValue;
  27.     document.getElementById("ID4").innerHTML=var1data4[0].firstChild.nodeValue;
  28.  
  29.       }
  30.     }
  31.  
  32.     XMLHttpRequestObject.send(null);
  33.   }
  34. }
  35.  
[HTML]
</script>
</head>
<body>
//all the variables are outputted here against the tag IDs

<script language="JavaScript" type="text/JavaScript">
timerID=setInterval("getfurnacedata()",1000);
</script>
</body>[/HTML]
Nov 2 '07 #1
1 1150
acoder
16,027 Expert Mod 8TB
Maybe one second is too soon. Try 5 seconds.
Nov 2 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: christopher.secord | last post by:
I would like have a little "loading..." tab not unlike the one that gmail uses and I would like to display that tab while an ajax call is made. The javascript to display the tab works. The...
9
by: Eric Wallstedt | last post by:
I have a page that "logs" changes made to input fields using ajax to pass data to a cgi. I use POST and it works fine most of the time (all the time in IE). But it fails when I get the data from...
13
by: Marvin Zhang | last post by:
Hi, I'm not familiar with web programming, but I have a problem here. I have a page. When a user click one button on it, I will use AJAX to request a PHP script which will do a bunch of tasks,...
10
by: shankwheat | last post by:
I'm experimenting with using a AJAX style "processing" icon. The process I'm running in the background with xmlHttp is intensive and takes a 5--10 secs to complete. Instead of my processing icon...
17
by: Arjen | last post by:
Hi, I want to reload 2 divs at one click. Ive tried: <a href = "javascript:void(0);"...
2
by: willl69 | last post by:
Hi All, Ive been having a problem of late with one of my sites that uses PHP5 / Ajax. The problem is that periodically the ajax functions lock up and it gets stuck in the loading phase of the...
3
by: willl69 | last post by:
Hi All, Ive been having a problem of late with one of my sites that uses PHP5 / Ajax. The problem is that periodically the ajax functions lock up and it gets stuck in the loading phase of the...
7
xNephilimx
by: xNephilimx | last post by:
lHi guys! I'm having a little problem that's getting on my nerves, I couldn't find a solution, I also tryed googling it and I found nothing... (my field of expertise is in AS 2 and 3, but I still...
11
by: =?Utf-8?B?R2VyaGFyZA==?= | last post by:
I have run into a situation that if a page/tab that uses the Ajax toolkit (using .net version 3.5) is closed before the Ajax enable controls complete loading, then IE locks up. Does it in both IE7...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.