My site has a refresh tag like this:
<meta http-equiv='refresh' content='400'>
I have some vídeos embedded and when they're playing I want to remove the refresh.
In a specific function that detects when video is playing I did this using JQuery:
$("meta[http-equiv='refresh']").remove();
But the page still refreshes after 400 secs.
Is there a way to solve this?
Removing the meta tag isn't an option, based on the link Robert Rozas added --> Using Javascript to override or disable meta refresh tag
Since I don't have your code I can't help completely, but below is a way to auto refresh the page on load & then stop refreshing it on an event.
Clicking on the Test Button will stop the refresh.. just hook this into your event and it should solve your problem -->
<script>
$(document).ready(function () {
$("#test").click(function (e) {
// This event will clear the timeout
clearTimeout(timeout);
});
var timeout = setTimeout(function()
{
// The refresh is occurring here
location.reload();
}, 4000);
});
</script>
<button id="test">Test</button>
The following will remove the meta tag (quotes removed)
$('meta[http-equiv=refresh]').remove();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With