如何更新从JavaScript元刷新使用异步调用的时候? [英] How can I update meta refresh from javascript when using asynchronous calls?
问题描述
我有一个使用元刷新到注销页面,空闲用户后清理系统。 (别担心,服务器也超时会话)
I have a system that uses a meta refresh to a logout page, which cleans up after idle users. (Don't worry, the server also times out the session)
我开始通过AJAX做一些操作(不是真正的XML,但那是题外话)。我可以运行的异步请求返回的JavaScript,所以我不知道是否有可能重新设置元刷新的页面上,这样它有更长的超时。通常的setTimeout调用只需添加一个新的超时,但不会取代元超时?
I started doing some operations via ajax (not really xml, but that's beside the point). I can run javascript returned from the async request, so I'm wondering if it's possible to reset the meta refresh on the page so that it has a longer timeout. The usual setTimeout calls just add a new timeout, but do they replace the meta timeout?
推荐答案
没有。 meta标签是PTED加载页面时,就好像是一个实际的HTTP头,和负荷的变化上不会产生任何影响跨$ P $。
No. The meta tag is interpreted when the page loads as though it were an actual HTTP header, and post-load changes have no affect on it.
你最好开沟元刷新,并完全依赖于JavaScript在适当的时候重新加载页面。如果你必须支持的客户端没有脚本,然后默认为使用元刷新结合JS无脚本页面重定向到启用脚本(元刷新免费)页面谁可以利用它的用户。
You're better off ditching the meta refresh, and relying entirely on JavaScript to reload the page when appropriate. If you must support clients without scripting, then default to a no-script page utilizing meta refresh combined with a JS redirect to script-enabled (meta refresh free) page for users who can take advantage of it.
这篇关于如何更新从JavaScript元刷新使用异步调用的时候?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!