Your help will be highly appreciated
I have the following code: To get this metatag From the website looks:
function count () {// This title gets: g_title = ('document.title +'); G_title_count = ('' document.title.split (''). Length + ''); G_title_length = ('' document.title.length + '') // It sees all metatags: g_metadata = document.getElementsByTagName ("meta") [i]; G_keywords = "test"; If (type off G-metadata! = 'Undefined') {if (g_metadata) {var i = 0; {If (g_metadata.name == 'keyword') {g_keywords [i] = (g_metadata.name [i] + g_metadata.content [i] for {i = 0; i l = 10; i ++} ); }}}}
This value currently gives the "test" specified in the above code:
document.form1.g_keywords.value = g_keywords < / Code>
However I need to capture metatags, descriptions and title keywords.
& lt; Title & gt; Test 1 & lt; / Title & gt; & Lt; Meta name = "keyword" content = "test2" /> & Lt; Meta name = "description" content = "test3" />
And then type it in a form:
& lt; Textarea name = "g_keywords" id = "g_keywords" cols = "80" line = "5" onchange = "calculation (this.form1)" & gt; & Lt; / Textarea & gt; It currently works for title
, but & lt; Meta name = "keywords" content = "" & gt;
Tags
if (g_metadata.name == 'keyword') {g_keywords [i] = (g_metadata.name [i] + g_metadata.content [i]); }
I have tried making the above but it is not sure how to execute it ...
Please help - thank you
// Collect all keywords g_metadata = document.getElementsByTagName ("meta"); G_keywords = []; // One array should be var len = g_metadata.length; {If (g_metadata [i] .name == 'keyword') for {var i = 0; i & lt; len; i ++} {g_keywords = g_metadata [i] .content.split (","); }}
I think there is only one keyword & lt; Meta & gt;
should be tagged, and all keywords are separated by commas []
Comments
Post a Comment