I'm getting confused passing the http://
in a string to the url as it is being stripped to
http%3A%2F%2F
I tried.. using the encodeURIComponent(http://)
but that didn't work either.. I'm trying to pass the url into here:
https://www.facebook.com/sharer/sharer.php?url=
Here is my code that isn't working:
$(document).on('click', '.fb', function(e) {
var findfb = $('.fb').parent().parent().parent().find(".zoomy").attr("src");
var facebook_url = 'http://www.facebook.com/sharer.php?url=http://www.site.com/folder1/'+encodeURIComponent(findfb)+
'&title='+encodeURIComponent('title of page');
window.open(facebook_url);
});
See Question&Answers more detail:os