473,624 Members | 2,238 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

AJAX html won't refresh after data update

I created a feature in a page where a DIV displays child records of
the current record. From this same page, I can submit the insertion of
a new child record. However, the while the previous child records
displayed fine, the newly added ones don't - until I close down IE and
restart it. I know, there's a setting in IE options which will force a
refresh on each page load, instead of caching, but I can't access it
from these computers (NT policy prohibits it, I guess). None of the
end users can either, so that's not a solution. Anything I can do
programmaticall y here?

Thanks.

Oct 4 '07 #1
21 4206
javelin wrote:
I created a feature in a page where a DIV displays child records of
the current record. From this same page, I can submit the insertion of
a new child record. However, the while the previous child records
displayed fine, the newly added ones don't - until I close down IE and
restart it. I know, there's a setting in IE options which will force a
refresh on each page load, instead of caching, but I can't access it
from these computers (NT policy prohibits it, I guess). None of the
end users can either, so that's not a solution. Anything I can do
programmaticall y here?
Add a 'unique' variable to the query string of you ajax URI so that
browser doesn't use the cached copy.

i.e.
obj.open('GET', 'ajax_call.php? recid='+recid+' &z='+
new Date().getTime( ),true);
HTH
Robin
Oct 4 '07 #2
javelin <go************ *@spamgourmet.c omwrote in
news:11******** **************@ 22g2000hsm.goog legroups.com:
I created a feature in a page where a DIV displays child records of
the current record. From this same page, I can submit the insertion of
a new child record. However, the while the previous child records
displayed fine, the newly added ones don't - until I close down IE and
restart it. I know, there's a setting in IE options which will force a
refresh on each page load, instead of caching, but I can't access it
from these computers (NT policy prohibits it, I guess). None of the
end users can either, so that's not a solution. Anything I can do
programmaticall y here?
Send an expired header with your data. Here's a straight lift from PHP
code:

//IE CACHES AJAX PAGES!!!
header("Expires : Sun, 19 Nov 1978 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");

.... followed by the correct headers and data for the XML or whatever output
you send back....
Oct 4 '07 #3
Dang, Robin! That actually works! Not used to getting such good help
the first time around :D

Thanks for the great idea.

J

On Oct 4, 9:52 am, Robin <a...@somewhere .comwrote:
javelin wrote:
I created a feature in a page where a DIV displays child records of
the current record. From this same page, I can submit the insertion of
a new child record. However, the while the previous child records
displayed fine, the newly added ones don't - until I close down IE and
restart it. I know, there's a setting in IE options which will force a
refreshon each page load, instead of caching, but I can't access it
from these computers (NT policy prohibits it, I guess). None of the
end users can either, so that's not a solution. Anything I can do
programmaticall y here?

Add a 'unique' variable to the query string of you ajax URI so that
browser doesn't use the cached copy.

i.e.
obj.open('GET', 'ajax_call.php? recid='+recid+' &z='+
new Date().getTime( ),true);

HTH
Robin

Oct 5 '07 #4
ct**@spvision.c om wrote:
On Oct 4, 9:52 am, Robin <a...@somewhere .comwrote:
>Add a 'unique' variable to the query string of you ajax URI so that
browser doesn't use the cached copy.

i.e.
obj.open('GET' ,'ajax_call.php ?recid='+recid+ '&z='+
new Date().getTime( ),true);

Dang, Robin! That actually works! Not used to getting such good help
the first time around :D

Thanks for the great idea.
That idea is BAD because it fills the browser cache with garbage, and so
eventually slows down access to other content. Unnecessarily.

Please don't top-post: http://jibbering.com/faq/
PointedEars
--
realism: HTML 4.01 Strict
evangelism: XHTML 1.0 Strict
madness: XHTML 1.1 as application/xhtml+xml
-- Bjoern Hoehrmann
Oct 5 '07 #5
Dang, Robin! That actually works! Not used to getting such good help
the first time around :D

Thanks for the great idea.

J

On Oct 4, 9:52 am, Robin <a...@somewhere .comwrote:
javelin wrote:
I created a feature in a page where a DIV displays child records of
the current record. From this same page, I can submit the insertion of
a new child record. However, the while the previous child records
displayed fine, the newly added ones don't - until I close down IE and
restart it. I know, there's a setting in IE options which will force a
refreshon each page load, instead of caching, but I can't access it
from these computers (NT policy prohibits it, I guess). None of the
end users can either, so that's not a solution. Anything I can do
programmaticall y here?

Add a 'unique' variable to the query string of you ajax URI so that
browser doesn't use the cached copy.

i.e.
obj.open('GET', 'ajax_call.php? recid='+recid+' &z='+
new Date().getTime( ),true);

HTH
Robin

Oct 5 '07 #6
Thomas 'PointedEars' Lahn said the following on 10/5/2007 2:00 PM:
ct**@spvision.c om wrote:
>On Oct 4, 9:52 am, Robin <a...@somewhere .comwrote:
>>Add a 'unique' variable to the query string of you ajax URI so that
browser doesn't use the cached copy.

i.e.
obj.open('GET ','ajax_call.ph p?recid='+recid +'&z='+
new Date().getTime( ),true);
Dang, Robin! That actually works! Not used to getting such good help
the first time around :D

Thanks for the great idea.

That idea is BAD because it fills the browser cache with garbage, and so
eventually slows down access to other content. Unnecessarily.
Pure nonsense.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Oct 5 '07 #7
Randy Webb wrote:
Thomas 'PointedEars' Lahn said the following on 10/5/2007 2:00 PM:
>ct**@spvision.c om wrote:
>>On Oct 4, 9:52 am, Robin <a...@somewhere .comwrote:
Add a 'unique' variable to the query string of you ajax URI so that
browser doesn't use the cached copy.

i.e.
obj.open('GE T','ajax_call.p hp?recid='+reci d+'&z='+
new Date().getTime( ),true);
Dang, Robin! That actually works! Not used to getting such good help
the first time around :D

Thanks for the great idea.
That idea is BAD because it fills the browser cache with garbage, and so
eventually slows down access to other content. Unnecessarily.

Pure nonsense.
(sic!)

It isn't nonsense, it's a fact. (Or have I overlooked your argument by any
chance?)
PointedEars
--
var bugRiddenCrashP ronePieceOfJunk = (
navigator.userA gent.indexOf('M SIE 5') != -1
&& navigator.userA gent.indexOf('M ac') != -1
) // Plone, register_functi on.js:16
Oct 5 '07 #8
Thomas 'PointedEars' Lahn said the following on 10/5/2007 7:41 PM:
Randy Webb wrote:
>Thomas 'PointedEars' Lahn said the following on 10/5/2007 2:00 PM:
>>ct**@spvision.c om wrote:
On Oct 4, 9:52 am, Robin <a...@somewhere .comwrote:
Add a 'unique' variable to the query string of you ajax URI so that
browser doesn't use the cached copy.
>
i.e.
obj.open('G ET','ajax_call. php?recid='+rec id+'&z='+
new Date().getTime( ),true);
Dang, Robin! That actually works! Not used to getting such good help
the first time around :D

Thanks for the great idea.
That idea is BAD because it fills the browser cache with garbage, and so
eventually slows down access to other content. Unnecessarily.
Pure nonsense.

(sic!)

It isn't nonsense, it's a fact. (Or have I overlooked your argument by any
chance?)
You have overlooked the argument. There is a very good reason for using
a query string to force a reload from the server. And no, headers and
server settings won't satisfy the need.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Oct 6 '07 #9
Thomas 'PointedEars' Lahn a écrit :
Randy Webb wrote:
>Thomas 'PointedEars' Lahn said the following on 10/5/2007 2:00 PM:
>>ct**@spvision.c om wrote:
On Oct 4, 9:52 am, Robin <a...@somewhere .comwrote:
Add a 'unique' variable to the query string of you ajax URI so that
browser doesn't use the cached copy.
Dang, Robin! That actually works! Not used to getting such good help
the first time around :D
Thanks for the great idea.
That idea is BAD because it fills the browser cache with garbage, and so
eventually slows down access to other content. Unnecessarily.
Pure nonsense.
(sic!)

It isn't nonsense, it's a fact.
sic !

It is well-known among competent Web developers that IE is suffering a
cache issue with XHR when the call method is "GET". And no headers will
do anything to it.

The only solution is to add a dummy unique variable to the querysting.

*That* is a fact among others !

--
laurent
Oct 6 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
1761
by: darrel | last post by:
I've been playing with prototype.js and scriptaculous to create some nice drag-and-drop interaction on my applications GUI. That's working well. Now I want to take the next step and start passing data back and forth between my page and the server via AJAX. In terms of .net, can someone give me the overall concept? Normally, I'd have a function in my codebehind that grabs a dataset and then binds that to a control on my aspx page.
1
2089
by: danxavier | last post by:
I successfuly installed dd.php and sajax.php files. It runs fine, but I would like to link the $items to an image. I called the field in mysql with the link "pic". Any help would be AWESOME!!! I've run out of ideas. Here's the script <?php /* CREATE TABLE `layout` ( `set` varchar(50) NOT NULL default '', `item` varchar(50) NOT NULL default '', `order` int(9) NOT NULL default '0',
0
5515
by: Phillip Ian | last post by:
Tried this over in CSharp.General and didn't get anything, so I thought I'd try again here. If there's an AJAX specific group I could ask this in, please let me know...I did look. I'm trying to code what I think is a fairly typical Master/Detail scenario with two GridViews, using AJAX. Using the Northwind sample, I have two ObjectDataSources - one which pulls data from the Orders table, and one that pulls the related data from . Each...
0
1833
by: angiemc | last post by:
Hi, I have a question about AJAX and ASP.Net controls. I'm working on a system that requires pages to be generated dynamically based on XML to provide the layout (eg text boxes, dropdowns, save button etc) and a dataset to provide the data to populate these fields. I'm tring to do this using composite controls. I would have a control to display a single record (formview), another control to display a grid of records (datasheet), another...
10
3451
by: paulie | last post by:
Hi, I have been experiencing an issue when trying to use AJAX to reload a DIV area using a timer of 2000ms, which contains a html page with another DIV and javascript. Scenario ------------- I have perl script which simply runs a ps on a Solaris server and generates a static html page with all of the code perfectly and this html page works fine when viewing it statically or with a META REFRESH header tag. The idea is to give the user...
6
1942
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 timer to load the php page via ajax every 15 seconds which checks the "pinguser" table to see if the user has any chat requests, then echoes them to a div on the page. what i REALLY want to do is have the ajax page see if there is a ping for the...
1
2956
by: soni2926 | last post by:
hi, we currently have a site done using asp.net 2.0, one of the pages has a datagrid, which displays some information. currently there is a refresh button, but we want to change this so that every few secs we can refresh it using ajax. using javascript to call the webservice, we're not using updatepanels. once the webservice returns its's results, as a dataset, how do we populate the table? I've done things before updating labels and...
4
11703
by: Peter | last post by:
ASP.NET 2.0 I have an AutoCompleteExtender which works fine- I am using name, id pair in the WebService , but what I am trying to do is: once the user selects an item from the AutoCompleteExtender I want to automatically retreive data from the database and populate the fields on the screen. How do I trigger a server side event after the user selects an item from the AutoCompleteExtender or retrieve data from database on client side...
0
8233
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8675
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8619
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8334
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8474
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7158
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5561
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
1784
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1482
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.