数据更新后AJAX html不会刷新 [英] AJAX html won't refresh after data update
问题描述
我在页面中创建了一个功能,其中DIV显示当前记录的子记录
。在同一页面上,我可以提交
的新子记录。然而,当前一个孩子的记录显示为好的时候,新添加的那些没有 - 直到我关闭IE并且
重启它。我知道,IE选项中有一个设置会强制刷新每个页面加载,而不是缓存,但我无法访问它
来自这些电脑(我想,NT政策禁止它)。
最终用户都不能,所以这不是解决方案。我能做什么
这里有节目吗?
谢谢。
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
programmatically here?
Thanks.
推荐答案
javelin写道:
javelin wrote:
我在一个页面中创建了一个功能,其中DIV显示当前记录的子记录
。在同一页面上,我可以提交
的新子记录。然而,当前一个孩子的记录显示为好的时候,新添加的那些没有 - 直到我关闭IE并且
重启它。我知道,IE选项中有一个设置会强制刷新每个页面加载,而不是缓存,但我无法访问它
来自这些电脑(我想,NT政策禁止它)。
最终用户都不能,所以这不是解决方案。我可以做什么
这里有编程?
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
programmatically here?
在ajax URI的查询字符串中添加一个''unique''变量,这样
浏览器就不会使用缓存了复制。
ie
obj.open(''GET'',''ajax_call.php?recid =''+ recid +''& z =''+
new Date()。getTime(),true);
HTH
Robin
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
javelin< go ************* @ spamgourmet.comwrote in
news:11 ********** ************@22g2000hsm.googlegro ups.com:
javelin <go*************@spamgourmet.comwrote in
news:11**********************@22g2000hsm.googlegro ups.com:
我在页面中创建了一个功能,其中DIV显示子记录
当前记录。在同一页面上,我可以提交
的新子记录。然而,当前一个孩子的记录显示为好的时候,新添加的那些没有 - 直到我关闭IE并且
重启它。我知道,IE选项中有一个设置会强制刷新每个页面加载,而不是缓存,但我无法访问它
来自这些电脑(我想,NT政策禁止它)。
最终用户都不能,所以这不是解决方案。我可以做什么
这里有编程?
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
programmatically here?
向您的数据发送过期的标头。这是PHP的直升机
代码:
// IE CACHES AJAX PAGES !!!
header(" ; Expires:Sun,1978年11月19日05:00:00 GMT");
header(" Last-Modified:" .gmdate(" D,d MYH:i:s") 。GMT);
标题(Cache-Control:no-store,no-cache,must-revalidate);
header(" Cache) -Control:post-check = 0,pre-check = 0",false);
header(" Pragma:no-cache");
....后跟正确的标题和XML数据或任何输出
你发回来....
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....
Dang,罗宾!这实际上有效!不习惯得到这么好的帮助
第一次出现:D
感谢您的好主意。
J
10月4日上午9:52,Robin< a ... @ somewhere.comwrote:
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写道:
javelin wrote:
我在页面中创建了一个功能,其中DIV显示当前记录的子记录
。在同一页面上,我可以提交
的新子记录。然而,当前一个孩子的记录显示为好的时候,新添加的那些没有 - 直到我关闭IE并且
重启它。我知道,在IE选项中有一个设置会强制每页加载一次刷新,而不是缓存,但我无法访问它
来自这些电脑(NT政策禁止它,我猜)。
最终用户都不能,所以这不是解决方案。我可以做什么
这里有编程?
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
programmatically here?
在你的ajax URI的查询字符串中添加一个''unique''变量,这样
浏览器就不会使用缓存了复制。
ie
obj.open(''GET'',''ajax_call.php?recid =''+ recid +''& z =''+
new Date()。getTime(),true);
HTH
Robin
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
这篇关于数据更新后AJAX html不会刷新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!