How to pass query string to facebook embedded player url

I am embedding facebook video player into my site.
The url is here

How to pass the value to query string to the facebook url,

<!doctype html>
<html>
<head>
<script>
function getParams() {

    var params = {},
        pairs = document.URL.split('?')
               .pop()
               .split('&');

    for (var i = 0, p; i < pairs.length; i++) {
           p = pairs[i].split('=');
           params[ p[0] ] =  p[1];
    }     

    return params;
}
</script>
</head>
<body>
<div id="fb-root"></div><script>(function(d, s, id) {  var js, fjs = d.getElementsByTagName(s)[0];  if (d.getElementById(id)) return;  js = d.createElement(s); js.id = id;  js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.3";  fjs.parentNode.insertBefore(js, fjs);}(document, 'script', 'facebook-jssdk'));</script>
<div class="fb-video" data-allowfullscreen="1" data-href="https://www.facebook.com/video.php?v=123123123">
</div>
</body>
</html>

here I need to change the facebook url by passing the query string.


Source: facebook

Leave a Reply