Return to Solutions Overview <-

Load external scripts like GSAP or Hammer.js in your new Webflow JavaScript project

(Still under development as of March 15th 2023)

<script>
/* Start of: [BMG.studio] Standard script */

// + Strings +

// Selectors

// Attributes


// + Main +
function main()
{
	console.log(`I'm working!`, gsap, Hammer)
}


// + Helper +

// Loading function
jQuery.loadScript = function (url, callback)
{
    jQuery.ajax(
		{
        url: url,
        dataType: 'script',
        success: callback,
        async: true
    })
}

// Loader
"undefined" == typeof Hammer
    ? $.loadScript("https://cdnjs.cloudflare.com/ajax/libs/hammer.js/2.0.8/hammer.min.js", function () {
          load2ndScript();
      })
    : load2ndScript();
    
function load2ndScript() {
    "undefined" == typeof gsap
        ? $.loadScript("https://cdnjs.cloudflare.com/ajax/libs/gsap/3.11.3/gsap.min.js", function () {
              main();
          })
        : main();
}

/* End of: [BMG.studio] Standard script */
</script>

FAQs

You still have an open question about BMG.studio and how we operate. Chances are good that you will find what you are looking for here:

Why does this FAQ exist?

Well. As of Wednesday, March 15th 2023, I think this component looks really cool.

Can I clone this FAQ component?

Yes. Yes you can. You can do so -> here <-

Still have questions?

It's okay to reach out. Use either email or our calendar tool