Title: Likes button and javascript cloned element
Last modified: August 22, 2016

---

# Likes button and javascript cloned element

 *  Resolved [manuelmasia](https://wordpress.org/support/users/manuelmasia/)
 * (@manuelmasia)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/likes-button-and-javascript-cloned-element/)
 * Hi and thank you 🙂
 * I’m trying to use “Like” extension on the front page of a blog (sorry, can’t 
   share the link yet) where posts are displayed in carousels. In order to allow
   infinite looping the carousel script clones some articles, but the “Like” button
   isn’t visible for the cloned elements.
 * In few words I’m seeing that the Like button doesn’t work well if appended, is
   that a known issue? Any advice on this?
 * TIA, Manuel 🙂
 * [https://wordpress.org/plugins/jetpack/](https://wordpress.org/plugins/jetpack/)

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Thread Starter [manuelmasia](https://wordpress.org/support/users/manuelmasia/)
 * (@manuelmasia)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/likes-button-and-javascript-cloned-element/#post-5238186)
 * Additionally, always if appended, I get this error on Chrome console:
 *     ```
       Uncaught TypeError: Cannot read property 'appendChild' of undefined        ->       widgets.wp.com/likes/likes-rest.js?ver=20140528:45 
   
       Uncaught SecurityError: Blocked a frame with origin "http://widgets.wp.com" from accessing a frame with origin "http://www.pixedelic.com". Protocols, domains, and ports must match.        ->        postmessage.js?ver=20140528:28
       ```
   
 * Thanks, Manuel 🙂
 *  Thread Starter [manuelmasia](https://wordpress.org/support/users/manuelmasia/)
 * (@manuelmasia)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/likes-button-and-javascript-cloned-element/#post-5238190)
 * Just realised that the problem occurs with Sharedaddy icons too, since they lose
   the callback on click event after appending them. There is any handler to trigger
   in order to preserve the right working both of the Likes button and of the Sharedaddy
   buttons?
 * TIA, Manuel 🙂
 *  Thread Starter [manuelmasia](https://wordpress.org/support/users/manuelmasia/)
 * (@manuelmasia)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/likes-button-and-javascript-cloned-element/#post-5238200)
 * Ok, since “Infinite scrolling” works fine, I won my laziness 🙂 and take a look
   at that module, so I fixed the Sharedaddy issue with:
 *     ```
       $('body').trigger('post-load');
       ```
   
 * But the “Likes” issue still remains… 🙁
 *  Thread Starter [manuelmasia](https://wordpress.org/support/users/manuelmasia/)
 * (@manuelmasia)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/likes-button-and-javascript-cloned-element/#post-5238225)
 * Here is a test page: [http://www.pixedelic.com/sandbox/](http://www.pixedelic.com/sandbox/)
 * The first post is from the php loop, the second, of course, is cloned and appended
   via jQuery. Thank you. Manuel 🙂
 *  Thread Starter [manuelmasia](https://wordpress.org/support/users/manuelmasia/)
 * (@manuelmasia)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/likes-button-and-javascript-cloned-element/#post-5238330)
 * I opened an issue on Github: [https://github.com/Automattic/jetpack/issues/1067](https://github.com/Automattic/jetpack/issues/1067)
   Don’t want to create a duplicate, but maybe that was the best place, sorry

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Likes button and javascript cloned element’ is closed to new replies.

 * ![](https://ps.w.org/jetpack/assets/icon.svg?rev=2819237)
 * [Jetpack - WP Security, Backup, Speed, & Growth](https://wordpress.org/plugins/jetpack/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/jetpack/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/jetpack/)
 * [Active Topics](https://wordpress.org/support/plugin/jetpack/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/jetpack/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/jetpack/reviews/)

## Tags

 * [javascript](https://wordpress.org/support/topic-tag/javascript/)

 * 5 replies
 * 1 participant
 * Last reply from: [manuelmasia](https://wordpress.org/support/users/manuelmasia/)
 * Last activity: [11 years, 8 months ago](https://wordpress.org/support/topic/likes-button-and-javascript-cloned-element/#post-5238330)
 * Status: resolved