Site logo

Archived topic

GetSiteControl JavaScript

7 replies · Started by Cheryl on February 19, 2018

Viewing posts 1–8 of 8

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

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>

Thanks Guys

Brilliant, stupid question where do I put the script?

Cheryl

Problem solved :-)

Glad you figured out!

This archived topic is closed to new replies.