Jquery Select meta[property=og:image]?

后端 未结 2 438
梦毁少年i
梦毁少年i 2021-02-02 07:19

I want to select in Jquery the main photo in a web page, I just have the url page. so I decided to use the meta written for Facebook sharing.

I want to select the conten

相关标签:
2条回答
  • 2021-02-02 08:06

    $('meta[property="og:image"]').attr('content')

    http://jsfiddle.net/ZxmCw/

    0 讨论(0)
  • 2021-02-02 08:08

    :image is parsed as a pseudo-selector. I think you need quotes around "og:image"

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