I have meta tag in Header like that..
<meta http-equiv='refresh' content='0;url=http://stackoverflow.com/'>
is it possible to Remove it Dynamically using jQuery ?
In order to implement different behavior when scripting support is enabled you should include the meta refresh between <noscript>
tags, like so
<noscript>
<meta http-equiv='refresh' content='0;url=http://stackoverflow.com/'>
</noscript>
and implement the desired functionality after loading the DOM. Something along the lines of:
$(window).load(function() {
// here
})
Confirmed working on the latest Firefox version
No.
First, loading the jQuery library would take way too long so you'd have to do it with straight Javascript if anything.
Second, even if the meta had an id and you placed the simplest JS snippet immediately after it:
<meta id="stopMe" http-equiv='refresh' content='0;url=http://stackoverflow.com/'>
<script>
var meta = document.getElementById('stopMe');
meta.parentNode.removeChild(meta);
</script>
it would still be too late because the content=0
in the meta means to execute the refresh immediately so the script will never be executed. If you placed the script before the meta it wouldn't work because there would be no DOM element yet to reference.
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