So, I have a single page app that plays videos from our database. The page loads on www.foo.com/player.php and I use PHP to set a video ID parameter to have a shareable URL. So the page loads, the share URL is inserted to both FB and Twitter as <http://www.foo.com/player.php?id=1> and the buttons share the proper URL. I'm using the standard implementations of both buttons. 

The issue is, when the user changes the video, neither button updates the URL, it still shows <http://www.foo.com/player.php?id=1>. 

I've tried to add this to my AJAX success function:

```
$(".facebook-share-button").data("href", "http://www.foo.com/player.php?id=" + data.videoID);
$(".twitter-share-button").data("url", "http://www.foo.com/player.php?id=" + data.videoID);

```

If I check those data attributes in the console, they show the proper URL, so I know it's update the attributes with what I want, but the button functions don't pick up the new URL. 

For Twitter, I found their suggestion to refresh the button with 

```
tweet_button.render();

```

But that doesn't update my shared URL. 

I also tried updating the browser's URL with the history.pushstate, and it does update in the browser's display, but still isn't detected by the share buttons. 

Anyone dealt this this issue?