Help get this topic noticed by sharing it on
Twitter,
Facebook, or email.
Twitter,
Facebook, or email.
Is it possible to use other javascript libraries?
I would like to use YUI instead of jquery (or in addition to). Is it possible to load up other libraries into my project and have them work inside my app?
-
You can add in whatever other external JS files you want via dynamic JS loading.
http://ntt.cc/2008/02/10/4-ways-to-dy... -
-
It's really depend on the library you want to use.
The best way to add external JS resources to your app is to use our @include statement like this:
@include "the-url-to-your-js-file"
note: the @include statement must be at the first character of the line and there should not be ';' at the end of the line.
This will add your code (that was fetched from the url) at the beginning of your app code.
As the nature of running inside a sandbox, some of the libraries will have to be slightly modified.
Also, as Mike suggested you can easily load your JS into the regular page/dom (if this is your intention!). You can also use Crossrider's API for this:
appAPI.dom.addRemoteJS("your-js-url");
//OR
appAPI.dom.addInlineJS("your-js-code"); -
-
Koby's answer is better. It is much cleaner to bring in the external js files via the appAPI call (and into the proper context).
I was still caught up in thinking of how to do things GreaseMonkey/Userscript style. -
Loading Profile...





EMPLOYEE
