social-share-kit icon indicating copy to clipboard operation
social-share-kit copied to clipboard

y.appendChild is not a function

Open KhaledOmara opened this issue 8 years ago • 4 comments

I caught this error: Error: TypeError: y.appendChild is not a function Source File: path-to-file/js/social-share-kit.min.js Line: 8

any Idea why am I seeing this?

KhaledOmara avatar Mar 28 '16 09:03 KhaledOmara

Please share your .init() code and HTML markup.

darklow avatar Mar 28 '16 11:03 darklow

HTML: `

`

JS: jQuery(document).ready(function($ept) { if($ept('.ssk-group').length){ SocialShareKit.init(); } });

KhaledOmara avatar Mar 29 '16 08:03 KhaledOmara

I doubt it will help, but could you try moving init outside jQuery? You don't have to worry about running this on jQuery ready or checking if elements exists. SSK js code does it already: https://github.com/darklow/social-share-kit/blob/master/dist/js/social-share-kit.js#L28

darklow avatar Mar 29 '16 19:03 darklow

Ok I'll move it outside checking if the elements exist. But I think this is not the issue.

Lenovo P70-AOn Mar 29, 2016 9:44 PM, Kaspars Sprogis [email protected] wrote:

I doubt it will help, but could you try moving init outside jQuery? You don't have to worry about running this on jQuery ready of checking if elements exists. SSK js code does it already: https://github.com/darklow/social-share-kit/blob/master/dist/js/social-share-kit.js#L28

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub

KhaledOmara avatar Mar 31 '16 06:03 KhaledOmara