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

后端 未结 2 1327
死守一世寂寞
死守一世寂寞 2021-02-14 09:27

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:47

    Have you tried this?

    jQuery(function($){
      var latitude = $('.geo meta[itemprop="latitude"]').attr("content");
      var longitude = $('.geo meta[itemprop="longitude"]').attr("content");
    });
    

提交回复
热议问题