Public HTML Pages (Static)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2014 08:40 AM
I'm looking to utilize ServiceNow as a platform for some custom javascript applications. Basically, we need to have a home grown JS application live "on top" of ServiceNow. I have all my javascript and CSS ready to go as UI Scripts and stylesheets, however I also need to have HTML templates which I can render through a javascript template engine (underscore).
So my question is: Is there any way to store static HTML that can be accessed via a JS ajax call? I realize you can use UI Pages for this, however there is a LOT of extra markup added which would defeat the template, as I am looking to use templates for block style content (a small form, a set of tabs, etc).
Any ideas?
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2014 10:01 AM
You can create a processor to get data from a table, and store your static html in the table.
We use this method to store and retrieve our jQuery and jQuery mobile .js files, .css files, as well as images.
For this we have defined a processor with the path "get_snc_public_file.do". So for example we can use the link "/get_snc_public_file.do?filename="jquery-1.10.2.min.js".
The processor script includes the following line to get the argument from the url:
var file_name = g_request.getParameter('filename').toString() + ''; |
Checkout this link: http://wiki.servicenow.com/index.php?title=Tutorial_4_Creating_a_Custom_Processor
Cheers,
Geoff.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2014 12:44 PM
Thanks, Geoff. That's a really great idea, and pretty simply/scalable to build. And it also gave me ideas on how to use processors as a means of bootstrapping the javascript application instead of UI pages.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2014 11:30 AM
Thanks - please mark as the correct answer if it helps you.
Cheers,
Geoff.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2014 10:21 AM
I think Geoff has a neat idea with the processor, but you could also try just using a Static HTML Content block and use your AJAX to pull out the HTML that is housed in there.
-Chris