Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

DOM meta tags

Explorer ,
May 18, 2007 May 18, 2007
Hi there!

I'm writing an extension for DW8 that retrieves the contents of a meta tag from the current XHTML document:

<meta name="SKU_Condition" content="some_name" />

So I've got the following from the Extending DW help and the API ref:

var dom = dw.getDocumentDOM(); //get the dom of the current document
var skuCondMeta = dom.getElementsByTagName(???);

I see that the getElements function returns a list of child tags for a given tag type like DIV, IMG, etc.

Where do I go from here?

-Scott

TOPICS
Extensions
337
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Explorer , May 18, 2007 May 18, 2007
Okay, here's the solution:

var dom = dw.getDocumentDOM(); //get the dom of the current document
var skuCondMeta = dom.getElementsByTagName("meta");
for ( counter = 0; counter < skuCondMeta.length; counter++)
{
if (skuCondMeta[counter].name == "some_name")
alert(skuCondMeta[counter].content);
}
Translate
Explorer ,
May 18, 2007 May 18, 2007
LATEST
Okay, here's the solution:

var dom = dw.getDocumentDOM(); //get the dom of the current document
var skuCondMeta = dom.getElementsByTagName("meta");
for ( counter = 0; counter < skuCondMeta.length; counter++)
{
if (skuCondMeta[counter].name == "some_name")
alert(skuCondMeta[counter].content);
}
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines