How to find and read metadata using jQuery (schema.org microformat)?

后端 未结 2 1919
面向向阳花
面向向阳花 2021-02-14 09:33

I\'m building a Google Maps application and I\'d like to read out the metadata, as specified by schema.org, from my HTML to plot my map markers.

For example:

<         


        
相关标签:
2条回答
  • 2021-02-14 09:40

    Have you tried this?

    jQuery(function($){
      var latitude = $('.geo meta[itemprop="latitude"]').attr("content");
      var longitude = $('.geo meta[itemprop="longitude"]').attr("content");
    });
    
    0 讨论(0)
  • 2021-02-14 09:41

    You can get at the data like so:

    $('meta[itemprop="latitude"]').attr('content')

    0 讨论(0)
提交回复
热议问题