Here is the code for retrieving the Meta Keywords, Description using Javascript.
var destination = window.location.href;
var meta_title = '',meta_description = '';
var meta = document.getElementsByTagName("meta");
for( var x in meta )
{
if(/^title$/i.test(meta[x]["name"]))
meta_title = meta[x]["content"];
if(/^description$/i.test(meta[x]["name"]))
meta_description = meta[x]["content"];
}
No comments:
Post a Comment