I try to get share count from Mail.ru social network (Мой Мир).
If I go to browser, put this URL http://connect.mail.ru/share_count?url_list=THIS_MY_URL&callback=1&func=?
and press enter, I'll get this response:
?(
{
"THIS_MY_URL":{"shares":10,"clicks":5}
});
This is my jQuery code:
var url = encodeURIComponent(location.href);
$.getJSON('http://connect.mail.ru/share_count?url_list=' + url + '&callback=1&func=?', function(response) {
alert(response[url].shares);
});
In Chrome console I get this message:
Uncaught TypeError: Cannot read property 'shares' of undefined
Whats wrong? How to make it work?
Help me please!