Streaming live at 10am (PST)

Get OG attribute using JavaScript


#1

I want to display the open graph image from a url. In my collection I have url field and from that I want I want to display the og attribute from that url.

Is it possible to get that from JavaScript?


#2

It depends on the site.


#3

Possible if it a Webflow site?

I’m also interested in the actual JavaScript snippet :blush:


#4

Then no, since CORS is disabled by default on Webflow sites.

Try it yourself, pasting it in your console and see the result:

$.get('https://webflow.com');

If you have a server-side proxy you can do that.


#5

Ok, thanks a lot @samliew.