473,324 Members | 2,179 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,324 software developers and data experts.

Ajax function doesnt seem to work under IE but works in mozilla

Hi on page load a javascript functions (timedCount()) is executed (timer) which executes another javascript function (ajax function:findprov(divtowrite) ) in turn this calls a php file to query a database and produce the total number of records.

It works under mozilla but not ie

the tpl file::

[HTML]</html>
<head>


<script language="javascript" type="text/javascript">
{literal}
var c=0;
var t;
window.onload = function(){



timedCount();
}

function timedCount()
{

t=setTimeout("timedCount()",3000);
findprov('tes');
}



var xmlHttp


function findprov(divtowrite)
{
DTW=divtowrite;


xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
}



var url="tstudents.php";
xmlHttp.onreadystatechange=stateChanged


xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function stateChanged()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{



document.getElementById(DTW).innerHTML=xmlHttp.res ponseText ;

}
}function GetXmlHttpObject()
{
var xmlHttp=null;try
{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
// Internet Explorer
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp;
}



{/literal}
</script>

<meta http-equiv="Content-Language" content="en-gb">



</head>


<body>
<table border="0" width="100%" id="table1">
<tr>
<p> <span id="tes"> </span> </p></td>

</tr>
</table>
</body>

</html>[/HTML]

the php file tstudents.php

Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3.  
  4. define('AT_INCLUDE_PATH','../');
  5. include_once (AT_INCLUDE_PATH.'include/ini.php');
  6.  
  7.  
  8. $students = new DataObjects_stu;
  9. $students->query("select * from {$students->__table} ");
  10.  
  11.  
  12.  
  13. $students->whereAdd("Id != 12345678900 ");
  14.  
  15.  
  16. $number_of_rows = $students->find();
  17.  
  18. echo "<font color=blue> <b>". $number_of_rows." </b> students  </font>";
  19.  
  20. ?>
In both cases (mozilla and ie) the number of records is retrieved so the db query is ok .. the difference is that in mozilla is updated when a record is added but in ie is not ..(tried with ie7,ie8)

Any help will be appreciated

Thanks
Sep 30 '08 #1
2 1672
that was a caching issue .. is fixed now ;)
Sep 30 '08 #2
gits
5,390 Expert Mod 4TB
that is often the case ;) ... typically you add a unique param to the request to avoid caching ... perhaps you could just drop a short note about your solution here so that users with similar problems in the future will see how they could fix such issues?

kind regards
Sep 30 '08 #3

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

Similar topics

1
by: geevaa | last post by:
http://www.phpbuilder.com/columns/kassemi20050606.php3 XMLHttpRequest and AJAX for PHP programmers James Kassemi Introduction: Although the concept isn't entirely new, XMLHttpRequest...
5
by: Heofz | last post by:
Hey all, I've been banging my head against a brick wall on this one for the last 12 hours, and the time has come for me to give up and consult the gurus on this one. The below URL contains a...
5
by: pbd22 | last post by:
Hi. I am having a hard time figuring this one out... I have a sign in page. in my sign in logic, the successful login uses forms authentication and assigns an HttpCookie for the site-wide...
5
by: makthar | last post by:
Hi I have a JSP that calls an Ajax function when a button is clicked. The Ajax function calls a servlet . The Ajax function works well in Mozilla , but in IE7 when the button is clicked it works...
6
by: John Doe | last post by:
Here's my issue: I have an instant messenger type feature for my site, its basically an ajax IM feature. I run with a mysql backend on the site, i have a div on my main page that runs a javascript...
1
by: bizt | last post by:
Hi, I am having my first real attempt at an ajax class as so far Ive managed to build one that, once instatiated, will allow me to define which function it will call on completion then retrieves...
2
by: burtonfigg | last post by:
I'm testing an ajax page - this works fine in Firefox: http://jimpix.co.uk/clients/a/ecards/defaultx.asp Click on any of the links on the right under the 'occassions' or 'others' headings, in...
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
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: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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.