Im developing a webapp for Android and iPhone. I need the “share in facebook” functionality, and i know i can use the url “http://www.facebook.com/sharer/sharer.php?u=”, appending the url to that to open the share in Facebook window we all know and love. Im trying to do it with JavaScript, but the url that is going to be shared must be appended dynamically…
I’ve tried so far:
function goP(){
var fname=${promo.urlPromocion};
window.location = "http://www.facebook.com/sharer/sharer.php?u="+${object.url};
}
With quotes, without quotes, with and without the + symbol between the facebook url and the url to share, even tried to hardcode an url. I don’t know if the JS function is even called. But, it doesn’t work. Here is the portion of gsp file where the function is called:
<div class="rrss" style= "width:60px; height:60px; float:left; margin-right:10px; margin-left:68px;" id="facebook"><a href="JavaScript:goP()"><img src="../images/img_mobile/1340130521_facebook.png"/></a></div>
Any help?
Thank you.
Change it to