I'm dynamically changing my <meta property="og:image" content="#">
and <meta property="og:title" content="#">
tags using jQuery (below). When I view the code via 'inspect' in Chrome, the tags have successfully been changed.
HTML:
<meta property="og:title" content="#">
<meta property="og:image" content="#">
jQuery:
$("meta[property='og:title']").attr("content", data.name);
$("meta[property='og:image']").attr("content", data.thumbnail.url);
But the Facebook debugger tool is still showing content="#"
for each. I'm assuming this is because Facebook reads the source code, before Javascript has a chance to replace the content.
Is there a way around this?
Thank you.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…