• Resolved manuelmasia

    (@manuelmasia)


    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/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter manuelmasia

    (@manuelmasia)

    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

    (@manuelmasia)

    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

    (@manuelmasia)

    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

    (@manuelmasia)

    Here is a test page: 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

    (@manuelmasia)

    I opened an issue on Github: 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.