This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 27164 - API to cancel <meta refresh>, so that XHTML content can use it as a script fallback
Summary: API to cancel <meta refresh>, so that XHTML content can use it as a script fa...
Status: RESOLVED WONTFIX
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: Needs Impl Interest
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL: https://html.spec.whatwg.org/#attr-me...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-24 19:52 UTC by contributor
Modified: 2015-08-14 13:21 UTC (History)
4 users (show)

See Also:


Attachments

Description contributor 2014-10-24 19:52:30 UTC
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
Comment 1 Ian 'Hixie' Hickson 2014-10-27 20:39:11 UTC
Can't you just read the attribute directly?
Comment 2 Andrea Rendine 2014-11-26 23:13:08 UTC
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".
Comment 3 Ian 'Hixie' Hickson 2014-11-28 04:12:48 UTC
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.
Comment 4 Andrea Rendine 2014-11-28 16:12:21 UTC
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.
Comment 5 Ian 'Hixie' Hickson 2014-12-01 19:20:42 UTC
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.
Comment 6 Anne 2015-08-13 07:17:59 UTC
No, XHTML is not compelling enough. Sorry. Thanks for the suggestion though, Andrea!
Comment 7 Andrea Rendine 2015-08-14 13:17:21 UTC
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. :)
Comment 8 Anne 2015-08-14 13:21:27 UTC
A modern site should not use XHTML.