Vote count:
0
I'm looking to have an automated FB share dialog appear after a successful ajax submission so that my visitor can share his or her action on my site. The opening of the dialog functions just fine.
The problem I am seeing is that I get a pop up blocker after the success. I am using the JS SDK for Facebook. Is there a way to prevent the pop up blocker from blocking the FB dialog?
That code looks like such:
$.ajax({
url: base_url + '/vote/cast/' + video,
async: false
})
.done(function( data ) {
console.log('Yay! Lets now share');
setTimeout(function() {
$('#fb-share-image').trigger('click');
shareFacebook( data );
window.location = '/';
}, 3000);
});
<div id="fb-root"></div>
<script>
var base_url = "{{ URL::to('/') }}";
// Initialize Facebook
window.fbAsyncInit = function() {
FB._https = (window.location.protocol == "https:");
FB.init({
appId: 'XXXXXXXXXXXX',
status: true,
cookie: false,
xfbml: true
});
};
// Asynchronously load FB SDK
(function() {
var e = document.createElement('script'); e.async = true;
e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
document.getElementById('fb-root').appendChild(e);
}());
var trans = new Object();
trans.photo_upload_button = '{{ trans('coronaboxing.fan_of_the_week.photo_upload_button') }}';
</script>
asked 4 mins ago
Aucun commentaire:
Enregistrer un commentaire