This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Specification: https://html.spec.whatwg.org/multipage/semantics.html Multipage: https://html.spec.whatwg.org/multipage/#attr-meta-http-equiv-refresh Complete: https://html.spec.whatwg.org/#attr-meta-http-equiv-refresh Referrer: Comment: Is there any known or planned way for Javascript to read and/or change the refresh time or the destination URI, so that the reload action can be prevented and a more tailored action set in place (e.g. a section reload via AJAX)? Posted from: 62.211.148.20 User agent: Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.104 Safari/537.36
Can't you just read the attribute directly?
I'm not just talking about the attribute value. It can be changed, or removed altogether, without affecting the behavior of the page. So reading it is unreliable. But I also wanted to now if there's a way to change the reload time, e.g. to delay it, or remove the instruction. This is the scenario I have in mind: a page whose content changes over time and a meta refresh tag to enable such a reload in a very basic way (also working if JS is disabled). Then the possibility for the script to read the reload value, use it as a variable for an AJAX content load/refresh. Of course the complete reload of the page is now useless, so it should be "stopped".
Just have the meta refresh for when there's no script, and when there is script, remove it and do it all directly from script.
It means relying on the <noscript> tag, I guess. I just wanted to know if there's an alternative way (i.e. XHTML proof). But I think it has to be solved in other ways.
Ah, right, because removing the element dynamically won't cause the refresh to change... interesting. Yeah, <noscript> is probably the way to go for now. An API would indeed help in the XHTML case. Not sure it's compelling enough to convince implementors to add this, though.
No, XHTML is not compelling enough. Sorry. Thanks for the suggestion though, Andrea!
I guess this means not being able to use <meta refresh> as a fallback in modern sites, when these sites are both modern as they implement AJAX content refresh AND an XML markup architecture, at least unless <noscript> becomes somehow part of XHTML. I strongly believed in it, as some beginners still think that removing <meta refresh> stops page reloading. So I tried. :)
A modern site should not use XHTML.