jssocials icon indicating copy to clipboard operation
jssocials copied to clipboard

Display JSsocials after Ajax form submission

Open tergra opened this issue 7 years ago • 2 comments

Hi ! I have an Ajax based form on my website, when a user hits "submit" it displays the content directly without refreshing the page. The problem is it should also display the JSsocials buttons right below the content to enable users to share them, but it doesn't. See by yourself, the second answer doesn't display JSsocials : printscreen

What should I do ? Thank you very very much :)

tergra avatar Jul 15 '17 08:07 tergra

Are you sure you are initializing jsSocials on the element once it's attached to the document?

tabalinas avatar Jul 16 '17 21:07 tabalinas

Well this is the problem, it is not initialized after Ajax displaying content is fired. I guess I should write something like this ?

content.load("http://localhost/simpleecode/ajax/",{id:post_id}, function(){
     /* new html now exists*/
    $(this).find('.classThatNeedsPlugin').somePlugin().slideDown('slow');      

});

If so what should I replace on this line ? $(this).find('.classThatNeedsPlugin').somePlugin().slideDown('slow'); ?

Thanks :)

tergra avatar Jul 18 '17 11:07 tergra