Skip to content

Instantly share code, notes, and snippets.

@bootjp
Last active January 21, 2017 11:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bootjp/747d21ae3400f24b53dcf7fa7ce4a739 to your computer and use it in GitHub Desktop.
Save bootjp/747d21ae3400f24b53dcf7fa7ce4a739 to your computer and use it in GitHub Desktop.
my wordpress ad switch javascript
(function() {
var metas = document.getElementsByTagName('head')[0].getElementsByTagName('meta');
for (var index = 0; index < metas.length; index++) {
if (metas[index].name === 'keywords' && metas[index].content.indexOf('技術系') !== -1) {
console.log('技術記事');
break;
}
}
console.log(index, metas.length);
if (index === metas.length) {
console.log('その他');
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment