Home › Forums › Support › GetSiteControl JavaScript This topic has 7 replies, 3 voices, and was last updated 6 years, 1 month ago by Leo. Viewing 8 posts - 1 through 8 (of 8 total) Author Posts February 19, 2018 at 4:51 am #500097 Cheryl Hi Guys Can anyone advise on best practice for launching a javascript via a button or menu link, here’s the snippet from GetSite Control Example: <script> function showWidget(){ _gscq.push(['show', 82297]); } </script> Regards Nigel February 19, 2018 at 10:03 am #500395 TomLead Developer Lead Developer Hi Cheryl, This should help: http://api.jquery.com/on/#event-handler Let me know ๐ February 20, 2018 at 1:11 pm #501410 Cheryl HiTom, Might be a little beyond me at the moment, would this help (I saw you recommended this). https://generatepress.com/forums/topic/embed-script-form/ Cheryl February 20, 2018 at 10:13 pm #501632 TomLead Developer Lead Developer For example, here’s your button: <a class="button launch-widget" href="#">My button</a> Here’s your javascript: <script> jQuery( '.launch-widget' ).on( 'click', function(e) { e.preventDefault(); _gscq.push(['show', 82297]); } ); </script> February 22, 2018 at 8:49 am #502979 LeoStaff Customer Support Hi Cheryl, Ksenia from GetSiteControl e-mailed me and provided this link that should solve your problem: https://getsitecontrol.com/howto/developer-documentation/how-display-widgets-based-your-site-logic-eg-button-clicks/ Maybe give them a shout if you have further questions on this. February 26, 2018 at 1:35 pm #506310 Cheryl Thanks Guys Brilliant, stupid question where do I put the script? Cheryl February 26, 2018 at 1:49 pm #506317 Cheryl Problem solved ๐ February 26, 2018 at 6:12 pm #506449 LeoStaff Customer Support Glad you figured out! Author Posts Viewing 8 posts - 1 through 8 (of 8 total) You must be logged in to reply to this topic. Log In Username: Password: Keep me signed in Log In