Changing sharing data
✓ Published0🌍 Public
LLayne Smith
Last edited Apr 23, 2015
Created on Apr 7, 2015
This example shows how to dynamically update social-media share metadata for a news story. The code reassigns variables such as `storyTitle`, `storyURL`, `storyImG`, and `leadText` to new values, then uses jQuery selectors to overwrite the corresponding `og:title`, `og:url`, `og:image`, and `og:description` meta tags in the page’s head. Finally, it re-fires the `shareInit` function on two share-bar elements to refresh the buttons with the updated data. It relies on the jQuery library for DOM manipulation and a custom `shareInit` function.
AI-generated description