Reputation: 352
Searched all over the internet but could not find anything about it.
How can I turn off this zurb foundation 5 meta tags in <head>
:
<meta class="foundation-mq-small">
<meta class="foundation-mq-small-only">
<meta class="foundation-mq-medium">
<meta class="foundation-mq-medium-only">
<meta class="foundation-mq-large">
<meta class="foundation-mq-large-only">
<meta class="foundation-mq-xlarge">
<meta class="foundation-mq-xlarge-only">
<meta class="foundation-mq-xxlarge">
<meta class="foundation-data-attribute-namespace">
Upvotes: 2
Views: 1379
Reputation: 4162
1) You shouldn't. They are needed for some Foundation's JS plugins.
2) If you want to just use Reveal Modal, you don't need removing these meta tags. You can simply include only this plugin into your webstie:
<script src="/js/foundation.js"></script>
<script src="/js/foundation.reveal.js"></script>
Or, if you are using foundation.min.js
, you can init only this plugin:
$(document).foundation('reveal');
3) If you are absolutely confident you want to remove these tags for some reason, you have three possibilities:
Editation of file foundation.js
Remove this part from the file foundation.js
.
header_helpers([
'foundation-mq-small',
'foundation-mq-small-only',
'foundation-mq-medium',
'foundation-mq-medium-only',
'foundation-mq-large',
'foundation-mq-large-only',
'foundation-mq-xlarge',
'foundation-mq-xlarge-only',
'foundation-mq-xxlarge',
'foundation-data-attribute-namespace']);
Removal by plain JavaScript (after include)
Include thit code snippet somwhere into your website. It should be run after Foundation initialization.
var metas = document.getElementsByTagName('meta');
for (index = metas.length - 1; index >= 0; index--) {
var metaClass = metas[index].getAttribute('class') || '';
if (metaClass.indexOf('foundation') > -1) {
metas[index].parentNode.removeChild(metas[index]);
}
}
Removal by jQuery (after include)
This code snippet needs jQuery, however, you should have it included already because Foundation depends on it. And, of course, it should be also run after Foundation initialization.
$('meta[class*=\'foundation\']').remove();
Upvotes: 4