php - Get Permalink (Current Page) With Share URL Is Not Working Properly -
i want use $facebookurl sharer php url avoid using sdk.
problem it's grabbing url incorrectly. i'm not coder.
please see code pen.
q. can advise on basics , i'm doing wrong?
setshareevents = function() { $(".myfacebookbtn").click(function() { var = $(window).width() / 2 - 425, b = $(window).height() / 2 - 350, c = { url: $(this).attr("data-share-link") }, c =facebook.com/sharer/sharer.php?=" + $.param(c); window.open( c, "popupwindow", "width\x3d850,height\x3d700,scrollbars\x3dno, top\x3d" + b + ", left\x3d" + ); ga("send", "social", "facebook", "share", $(this).attr("data-share-link") ); });
you can view code pen
q. doing wrong?
you can see working there : codepen.io
$(".myfacebookbtn").click(function() { var = $(window).width() / 2 - 425, b = $(window).height() / 2 - 350, c = { u: $(this).attr("data-share-link") }, c ="https://www.facebook.com/sharer/sharer.php?" + $.param(c); window.open( c, "popupwindow", "width\x3d850,height\x3d700,scrollbars\x3dno, top\x3d" + b + ", left\x3d" + );
the parameters of var 'c' need 'u' , not 'url'.
and need add data-share-link="http://somelink.com" in li class 'myfacebookbtn' .
hope helps.
cheers
Comments
Post a Comment