How do I call a js library from a UI script and where do I store that library?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-01-2016 11:18 AM
We are implemented an internal analytics tool into our instance. I have the script tags within a global UI script and there is its own JS library. I created the library as a UI script as well since I saw jquery.min is stored there. Is that the right approach? If so, how do I call it in the scirpt tag? I tried calling it by sys_ui_script/<NAMEOFSCRIPTINCLUDE> but got a ton of errors in the console.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-01-2016 01:05 PM
I get this error in the console: Cannot read property 'appendChild' of null
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-01-2016 03:08 PM
Blair,
I would change the src to be src="file.min.jsdbx"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-01-2016 03:49 PM
Chris,
Now I get this error: Uncaught SyntaxError: Unexpected token <
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-01-2016 05:23 PM
From here I would have to ask where are you trying to execute the script?
It appears that since this is marked as a global UI script it is going to be running, well globally meaning that you don't have to necessarily use this in a UI type page (UI, CMS, etc. ).
Anyway basically the error means that there is an extra "<" somewhere in your code or where ever you may be trying to use it.
Attached is a screenshot showing a simple example of this working as it is.