473,434 Members | 1,793 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,434 software developers and data experts.

internet explorer does actually be refreshing the data after Ajax call

82
I'm using AJAX on my website, but internet explorer does not seem to actually be refreshing the data I retrieve via AJAX when I refresh the page. For example, I have a button that when pressed uses an XMLHttpRequest to go read some data from a database then returns it to the browser for display. It looks like:

Press button
XMLHttpRequest gets data from db
XMLHttpRequest renders returned data in client browser

I can update the records in the database, ask the page to retrieve data but it doesn't seem to 'see' the new records unless I close the browser, and open a new instance. Then it picks up the changes.

Also if I go into the IE settings and choose 'Check for newer versions of stored pages: Every visit to the page' it works perfectly.

I can't rely on users to have chosen that setting though, so what can I do to get around this behaviour?
Apr 29 '08 #1
7 2415
gits
5,390 Expert Mod 4TB
i have one doubt about your question, that you could clarify i think: why do you refresh the page when you use ajax? the ajax call itself should retrieve the data and updates the widget where the data are to be displayed. even when you need to refresh the page ... then just trigger the ajax call to read the data in the page's onload to init the widget ...

kind regards
Apr 29 '08 #2
raknin
82
i have one doubt about your question, that you could clarify i think: why do you refresh the page when you use ajax? the ajax call itself should retrieve the data and updates the widget where the data are to be displayed. even when you need to refresh the page ... then just trigger the ajax call to read the data in the page's onload to init the widget ...

kind regards
Thanks Gits,

I don't refresh the all page just a portion of the page.
The scenario is as following:
1) I show a list of reviews summary in a div using Ajax call
2) In the same div if the user choose to add review I open the add review form
3) The new review is addded to the database using Ajax call after user choose add.
3) I make again an Ajax call to refresh the div with the updated lists of reviews.

But when I do that, the div does't refresh. Only after I make the changes in the IE browser setting the div refresh.

I think know the process is clear.You can try it yourself.
Apr 29 '08 #3
gits
5,390 Expert Mod 4TB
in this case there is something wromg with the 'flow' ... could you post the code you use? for the add-operation and the followup read-operation? note that the read has to wait for the add so it has to be started in the onreadystatechange of your add-operation ... ?

kind regards
Apr 29 '08 #4
raknin
82
This is what I do exactly, so actualy what I want to know how can I tell the browser not to load what is currently in its cache but to load the newer version of the storage page. look at internet explorer -> internet options -> temporary internet files -> settings -> check for the newer versions of the storged pages, throgh a javascript. I believe i need to clear the browser cache
Apr 29 '08 #5
gits
5,390 Expert Mod 4TB
just add a unique dummy paramater to the query string:

Expand|Select|Wrap|Line Numbers
  1. query_string + '&d=' + (+ new Date);
kind regards
Apr 29 '08 #6
raknin
82
Thanks gits for the workaround, it works!!!
Apr 29 '08 #7
gits
5,390 Expert Mod 4TB
no problem :) ... post back to the forum anytime you have more questions ...

kind regards
Apr 29 '08 #8

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

Similar topics

25
by: Jeff | last post by:
Use the MS Script Editor included free with MS Office 2002 and above, for debugging Internet Explorer (IE). This subject is of great interest to many JS developers, as there is no obvious, low...
21
by: Joe Attardi | last post by:
Hey all! I was reading over at the IE Blog the other day http://http://blogs.msdn.com/ie/] and read some interesting, and encouraging news. According to Sunava Dutta, an IE Program Manager,...
1
by: Apu Nahasapeemapetilon | last post by:
Hello and thank you in advance for your help. Can anyone think of a reason why this code would work properly on one PC, but not another? I've got a System.Windows.Forms.UserControl that...
1
by: mubarak basha | last post by:
hi, i wrote the following coding.......... <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Getting...
0
by: AndySummers | last post by:
Hi We have just re-written a majour asp.net project to use a user control embedded in a web page. The main dll references 3 other custom controls and so to deploy the project I copy the 4 dll's to...
2
by: JDeats | last post by:
>From my development envrionment (i.e. a single WinXP notebook PC) I have a basic AJAX application that is making the call to a Windows Form page that just returns the request back to the AJAX...
3
by: mthomsit | last post by:
Hi, I have a script which after a time shows the following error in IE: "A script on this page is causing Internet Explorer to run slowly. If it continues to run, your computer may become...
15
by: moltendorf | last post by:
I have created a little chat application that seems to work 100% on Mozilla Firefox, Google Chrome, and Safari, (tried it in Opera, and it seems to work, but the cookies are screwing everything up;...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.