Created
October 31, 2012 08:17
-
-
Save ranaroussi/3985816 to your computer and use it in GitHub Desktop.
extract meta keywords of a web page
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function get_meta_keywords() { | |
var meta_keywords = ''; | |
var metas = document.getElementsByTagName('meta'); | |
if (metas) { | |
for (var x=0,y=metas.length; x<y; x++) { | |
if (metas[x].name.toLowerCase() == "keywords") { meta_keywords += metas[x].content; } | |
} | |
} | |
return meta_keywords; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment