How can I include external js script files in <head> tag of CMS Pages
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2015 08:30 AM
Hi,
I am working on a cms portal where I need to reference external js scripts to each page of portal. It should only be included in all pages of a specific portal but not all portals.
Eg follow two files I need include in <head> tag of each page
<script>https://www.abcdegf.net/assets/jquery.min.js"></script>
<script>https://www.abcdegf.net/assets/js/xyxscripts.1.1.js"></script>
I tried adding above scripts in a content block but it gets added in a table <td> tag eg in <td id="dropzone0" dropzone="true" width="100%">.
I am wondering if there is any way I can above include external js scripts files in <head> tag of all CMS pages.
Any help much appreciated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-25-2015 09:19 AM
Seems like servicenow does not allow the scripts to put in header unless they are global scripts
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2015 02:01 AM
please use:
System UI -> UI Script
create a ui script then put info of javascript into that
you can use in cms
<g:include_script src="name_UISCRIPT.jsdbx" />
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2015 07:30 AM
You can use hungpro's suggestion and place that statement on the layout used on the portal. Then use that layout on the site level or specific page level of your portal.
Or do the same with your own script that you posted. Either one should work.
Or you can write a script to push your script tags to head.