Начиная с 2013 года, если вы используете facebook.com/sharer.php (PHP), вы можете просто создать любую кнопку / ссылку, например:
<a class="btn" target="_blank" href="http://www.facebook.com/sharer.php?s=100&p[title]=<?php echo urlencode(YOUR_TITLE);?>&p[summary]=<?php echo urlencode(YOUR_PAGE_DESCRIPTION) ?>&p[url]=<?php echo urlencode(YOUR_PAGE_URL); ?>&p[images][0]=<?php echo urlencode(YOUR_LINK_THUMBNAIL); ?>">share on facebook</a>
Параметры запроса ссылки:
p[title] = Define a page title
p[summary] = An URL description, most likely describing the contents of the page
p[url] = The absolute URL for the page you're sharing
p[images][0] = The URL of the thumbnail image to be used as post thumbnail on facebook
Это просто: вам не нужны никакие js или другие настройки. Это всего лишь HTML-ссылка. Создайте тег A любым способом, который вы хотите.
var last = new Date().getTime();
window.addEventListener('click', function(event) {
var now = new Date().getTime();
console.log(event.pageX, event.pageY);
console.log(now-last);
console.log((now-last) / 1000);
if ( (now-last) < 2 * 60 * 1000 ) {
console.log('clicked less than two minutes ago');
}
last = now;
});
class ClickTracker extends Component {
trackClick(e){
}
componentWillMount() {
document.addEventListener('click', this.trackClick);
}
componentWillUnmount() {
document.removeEventListener('click', this.trackClick);
}
render(){
return (
{this.props.children}
);
}
}