繁体   English   中英

在Mozilla Firefox中使用JavaScript查找正文中的元标记

[英]Find metatags in body with javascript in Mozilla Firefox

如何在Mozilla Firefox的正文部分中找到元标记?

例:

<!DOCTYPE html>
    <head profile="http://microformats.org/profile/hcalendar"></head>
    <body>
    <div itemscope itemtype="http://data-vocabulary.org/Event">
        <a href="http://www.example.com/events/spinaltap" itemprop="url" ><span itemprop="summary">Spinal Tap</span></a>
        <img itemprop="photo" src="spinal_tap.jpg" />
        <span itemprop="description">After their highly-publicized search for a new drummer,Spinal Tap kicks off their latest comeback tour with a SanFrancisco show.</span>
        When:
        <time itemprop="startDate" datetime="2015-10-15T19:00-08:00">Oct 15, 7:00PM</time>—
        <time itemprop="endDate" datetime="2015-10-15T19:00-08:00">Oct 15, 9:00PM</time>
        Where:
        <span itemprop="location" itemscope itemtype="http://data-vocabulary.org/?Organization">
            <span itemprop="name">Warfield Theatre</span>
            <span itemprop="address" itemscope itemtype="http://data-vocabulary.org/Address">
                <span itemprop="street-address">982 Market St</span>, 
                <span itemprop="locality">San Francisco</span>, 
                <span itemprop="region">CA</span>
            </span>
            <span itemprop="geo" itemscope itemtype="http://data-vocabulary.org/?Geo">
                <meta itemprop="latitude" content="35.774929"/>
                <meta itemprop="longitude" content="-122.419416"/>
            </span>
        </span>
        Category: <span itemprop="eventType">Concert</span> 
    </div>
    </body>
</html>

似乎Firefox将meta标签移到了头部,使得它们作为itemprop =“ geo”的子元素无法访问。 是否有比通过标签名称获取lat / lng元标签,然后将它们与itemtype =“ Event”一起困惑的更好的方法?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM