开发者

html reload without javascript [duplicate]

This question already has answers here: No-Javascript Detection Script + Redirect (4 answers) Closed 6 years ago. 开发者_如何学Python

I'm writing a hobby project and i was wondering if I can implement the following functionality:

If the browser has JS disabled, the page reloads every X seconds.

If the browser has JS enabled, the page receives some JS event from somewhere and reloads. But the page does not reload every X seconds.

I'm trying to implement server push in the app and it works, but I also want to have some at least semi-reasonable fallback mechanism.

Any suggestions?

A different way to phrase the question is:

Can I disable this(in a cross-platform way):

<META HTTP-EQUIV="refresh" CONTENT="15">

After the page has loaded?


Why not just put that in a <noscript> tag? Does that not work? I forget whether this is "acceptable" but several years ago it used to work, if I remember correctly.


You could put a meta-refresh in a noscript tag?

<html>
  <head>
    <title>Meta refresh if no javascript</title>
    <noscript>
      <meta http-equiv="refresh" content="1">
    </noscript>
  </head>
 <body>

    ...

 </body>
</html>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜