D
D
Dmitry Filandor2015-03-29 07:20:12
JavaScript
Dmitry Filandor, 2015-03-29 07:20:12

How to automatically share a post on social networks?

Hello! I want to make such a trick:
When creating a post, at the bottom of the page (before the publish button it says send your post to social networks) and there are checkboxes:
VK, Googleplus, FB, etc.
Here's what happened:

var popup = window.open(' [url]https://plus.google.com/share?url=http://aforizmus.com/aphorism/1484[/url]',  width = 350, height = 200);
        popup.blur();
        popup.focus();
 
        var popup1 = window.open('https://www.facebook.com/sharer/sharer.php?src=sp&u=http://aforizmus.com/aphorism/1484',  width = 400, height = 150);
        popup1.blur();
        popup1.focus();
 
        var popup2 = window.open('https://twitter.com/intent/tweet?text=' + $('#TextBL').val() + ' &url=http://aforizmus.com/aphorism/' + $('#hiddenID').val() + ' ', width = 350, height = 150);
        popup2.blur();
        popup2.focus();
 
        var popup3 = window.open('http://connect.ok.ru/dk?st.cmd=WidgetSharePreview&st.shareUrl=http://aforizmus.com/aphorism/' + $('#hiddenID').val() + '&st.comments=' + $('#TextBL').val(), width = 350, height = 150);
        popup3.blur();
        popup3.focus();
 
        
        var popup4 = window.open('http://vk.com/share.php?url=http://aforizmus.com/aphorism/' + $('#hiddenID').val() + '', width = 300, height = 350);
        popup4.blur();
        popup4.focus();
 
 
        var popup5 = window.open('http://connect.mail.ru/share?url=http://aforizmus.com/aphorism/' + $('#hiddenID').val()+' &description= '+$('#TextBL').val() +' ', width = 300, height = 350);
        popup5.blur();
        popup5.focus();

does what it needs, but does not open 6 pop-up windows, only classmates, FB and mail ru ... commented out the social networks that open, launched it - as a result, VK and Twitter opened, and Google Plus did not open again .... I suspect - either then a ban on multiple opening of windows, or the social network does not have time to open the window .... I will be glad for any ideas ...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artyom Fedosov, 2015-03-29
@asleepwalker

You are still lucky, for many people pop-up windows do not pop up at all.
The idea of ​​an adequate implementation: to make a pop-up dialog, in which the iframes of the necessary social networks will be displayed one by one. At the same time, you can fasten the progressbar.
Of the minuses: if your pages are opened via HTTPS, then frames with HTTP will not be displayed due to security policy, in the opposite direction - you can.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question