Are there any solution to change html's meta property at run time in gwt?

I try to change meta properties:

JQuery.select("meta[property='og\\:url']").attr("content", builder.buildString());
JQuery.select("meta[property='og\\:title']").attr("content", Window.getTitle());
JQuery.select("meta[property='og\\:video']").attr("content", videoURL);
JQuery.select("meta[property='og\\:image']").attr("content", pictureURL);

and when I check:

 Window.alert(" url: " +JQuery.select(("meta[property='og\\:url']")).attr("content") + " title: "+ JQuery.select(("meta[property='og\\:title']")).attr("content") + " video: " + JQuery.select(("meta[property='og\\:video']")).attr("content") + " image: "             + JQuery.select(("meta[property='og\\:image']")).attr("content")  );

the popup shows the correct new meta properies, but when I try to share, facebook use the old meta values.

有帮助吗?

解决方案

Facebook doesn't execute js code, it only reads the HTML as is. You'll maybe need to create a JSP that will be specific to facebook, this is not useless work since you need that job done for SEO too

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top