I am trying to make this meta tag always have the current URL of the page it is on.
<meta property="og:url" content="http://shop.famsf.org/do/product/BK5160" />
How would I go about changing a meta tag with JS or JQ?
I am trying to make this meta tag always have the current URL of the page it is on.
<meta property="og:url" content="http://shop.famsf.org/do/product/BK5160" />
How would I go about changing a meta tag with JS or JQ?
Changing Facebook meta tag Content Attribute using JQuery
It is definitely possible to change meta tags using jQuery, but I don't think that's going to accomplish what you want since the meta tags are pulled by the FB scraper. The FB scraper goes out and scrapes your page to read the meta tags.
https://developers.facebook.com/docs/opengraph/
BUT if you want to do this:
You just grab a meta tags with the name 'og:url' and set its content attribute like this :
Property not working i used like that:
Select the element using tagname and attribute. Set the value using
.attr()
: