How do i include a javascript library?
Recently i tested a project and it failed at before the simulator could even start. I figured out that it happens after i included a javascript library, jxs.js and underscore.js specifically.
How do i include them without having a crash?
4 Answers
-
Here's a screencast detailing how to include underscore.js as a CommonJS module for use in Titanium.
-
ok actually it is "underscore.js" which makes all the trouble, even if i don't include it using the include function Titanium doesn't like him to be there…
-
Sometimes if a library has too many warnings/errors in JSLint, it causes the project to bomb out before being launched in the simulator. Are you seeing a ton of JSLint warnings in the console?
-
I ran into the same problem… it's line 644 or something:
- "');}return p.join('');");
Just move the + onto the previous line and you should be fine.