Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How may I disable an http-equiv refresh in JavaScript?

I'm building a status page which should be refreshed periodically.

So, I've had a http-equiv refresh in the <head> section in order to refresh the page every minute :

<meta http-equiv="Refresh" id="refresh" content="60"/>

But, for browser supporting JavaScript, I would like to send an Ajax request checking if the page should be refreshed or not. And so, I would like to disable that http-equiv refresh in JavaScript (because it's Ajax which will do the work).

I tried to remove the tag using JavaScript/PrototypeJs but that doesn't work :

 $('refresh').remove();

It seems that the browser keep trace of that timer and doesn't take care of that DOM update.

Any idea ?

like image 231
paulgreg Avatar asked Feb 28 '23 18:02

paulgreg


1 Answers

Not exactly sure, but maybe:

<noscript>
    <meta http-equiv="Refresh" id="refresh" content="60"/>
</noscript>
like image 77
a paid nerd Avatar answered Mar 03 '23 08:03

a paid nerd