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

后端 未结 2 1922
面向向阳花
面向向阳花 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");
    });
    

提交回复
热议问题