Title: Small JavaScript Bug
Last modified: August 24, 2016

---

# Small JavaScript Bug

 *  Resolved [Jarred Kennedy](https://wordpress.org/support/users/jarred-kennedy/)
 * (@jarred-kennedy)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/small-javascript-bug/)
 * Hello, I have discovered a small issue in ssb-script.js
 *     ```
       $(document).on('click', '.ssb-share a', function() {
   
       	var ssb_site = $(this).attr('class');
       	var post_id = $(this).parent().attr("post_id");
       	var count = parseInt($(this).children('.count').text());
   
       	$.ajax(
       		{
       			type:"POST",
       			url:ssb_ajax.ssb_ajaxurl,
       			data:
       				{
       					action:"ssb_ajax_form",
       					ssb_site:ssb_site,
       					post_id:post_id
       				},
       			success:function(data) {
       				$('.ssb-share-'+post_id+' a.'+ssb_site).children('.count').text(count+1);
       				$('.ssb-share-'+post_id+' a.'+ssb_site).prop('disabled',true);
       				$('.ssb-share-'+post_id+' a.'+ssb_site).css('cursor','not-allowed');
       			}
       		})
       });
       ```
   
 * The post_id attribute is not passed because in the default style the parent of
   the ‘a’ element is another ‘div’, which has no attribute ‘post_id’, instead that
   div’s parent has the ‘post_id’ attribute.
 * Thanks.
 * [https://wordpress.org/plugins/social-share-button/](https://wordpress.org/plugins/social-share-button/)

Viewing 1 replies (of 1 total)

 *  [paratheme](https://wordpress.org/support/users/paratheme/)
 * (@paratheme)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/small-javascript-bug/#post-5958890)
 * Thanks for the report, share count for default 2 themes are not counting or not
   recording to database.
 * later version we are planning to display share count from organic count by API
 * Thanks

Viewing 1 replies (of 1 total)

The topic ‘Small JavaScript Bug’ is closed to new replies.

 * ![](https://ps.w.org/social-share-button/assets/icon-256x256.png?rev=2554777)
 * [Social Share Button](https://wordpress.org/plugins/social-share-button/)
 * [Support Threads](https://wordpress.org/support/plugin/social-share-button/)
 * [Active Topics](https://wordpress.org/support/plugin/social-share-button/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/social-share-button/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/social-share-button/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [paratheme](https://wordpress.org/support/users/paratheme/)
 * Last activity: [11 years, 1 month ago](https://wordpress.org/support/topic/small-javascript-bug/#post-5958890)
 * Status: resolved