UI Pages without all the extra platform HTML

If you create a empty UI pages you will notice that without anything on the page, the platform has already loaded in a ton of platform code including JavaScript (js_includes), CSS (css_includes), as well as quite a bit of HTML. If you are looking to build a page that includes jQuery, Angular, Bootstrap, or other JavaScript or CSS library, chances are you will run into a conflict.

The following trick was originally brought to my attention by Will Leingang, who recently wrote a blog post about it. However because I think this is a very important trick to know, I am going to post it as well.

The solution is to append “?sysparm_direct=true” to the end of the URL (after .do).

Before:

UI page framework template servicenow

After:

UI PAGE script custom

This method technically also works for CMS pages, however because CMS pages also load some additional javascript files to the page, if you remove the framework template you will get several JavaScript errors. There are some ways around this as well but require overloading some platform files, so that will be beyond the scope of this blog post.

2 comments

Leave a Reply to Abhijeet Bhosale Cancel reply

Your email address will not be published. Required fields are marked *