Public HTML Pages (Static)

jmpierce
Kilo Explorer

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!

4 REPLIES 4

geoffcox
Giga Guru

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.


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.


Thanks - please mark as the correct answer if it helps you.


Cheers,


                  Geoff.


cwilker10
Giga Expert

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