Picture of Oscar Arango
Linking a file on a cdn to the theme
by Oscar Arango - Friday, 14 April 2017, 1:11 PM
 

Good Morning,

 

Struggling with integrating an external JS file from a cdn into the defualt JS file for the vanilla theme.  Once I make that connection, I want to add some code like below:

    $("#card").flip();
 
I've tried using the define(['./jquery.flip.min.js'] but it doesn't seem to be doing anything.  Also I think Adapt doesn't like the JQuery code.
 
As a reference, I trying to embed this: https://nnattawat.github.io/flip/
 
thanks,
Picture of Oliver Foster
Re: Linking a file on a cdn to the theme
by Oliver Foster - Friday, 14 April 2017, 6:12 PM
 

Hi. 

In Adapt define statements are only used in the compiler and only with extreme hackiness can you use it in the browser. Please use modernizr.load instead. You can see examples in SRC/core/js/scriptLoader