<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: How to include a JavaScript library within the ServiceNow head tag? in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/how-to-include-a-javascript-library-within-the-servicenow-head/m-p/2070967#M727893</link>
    <description>&lt;P&gt;Well the use case is pretty simple, I would like to include a monitoring framework such as Dynatrace into my ServiceNow instance. It works ok with a global ui script, but it is stuck in the page iFrame which is not the perfect solution.&lt;/P&gt;&lt;BR /&gt;</description>
    <pubDate>Wed, 01 Feb 2017 13:27:26 GMT</pubDate>
    <dc:creator>wolfgangb</dc:creator>
    <dc:date>2017-02-01T13:27:26Z</dc:date>
    <item>
      <title>How to include a JavaScript library within the ServiceNow head tag?</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-include-a-javascript-library-within-the-servicenow-head/m-p/2070965#M727891</link>
      <description>&lt;P&gt;I understand that ui scripts that are marked as global are loaded with every page that ServiceNow loads. These pages are running within an iframe. &lt;/P&gt;&lt;P&gt;How can I include a JavaScript library within the global head HTML tag for each page?&lt;/P&gt;</description>
      <pubDate>Wed, 01 Feb 2017 12:36:11 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-include-a-javascript-library-within-the-servicenow-head/m-p/2070965#M727891</guid>
      <dc:creator>wolfgangb</dc:creator>
      <dc:date>2017-02-01T12:36:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to include a JavaScript library within the ServiceNow head tag?</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-include-a-javascript-library-within-the-servicenow-head/m-p/2070966#M727892</link>
      <description>&lt;P&gt;Hi Wolfgang,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Can you clarify what it is you are trying to do? What requirement is driving you to the solution that you need a JS library loaded on every page?&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 01 Feb 2017 13:09:12 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-include-a-javascript-library-within-the-servicenow-head/m-p/2070966#M727892</guid>
      <dc:creator>Chuck Tomasi</dc:creator>
      <dc:date>2017-02-01T13:09:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to include a JavaScript library within the ServiceNow head tag?</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-include-a-javascript-library-within-the-servicenow-head/m-p/2070967#M727893</link>
      <description>&lt;P&gt;Well the use case is pretty simple, I would like to include a monitoring framework such as Dynatrace into my ServiceNow instance. It works ok with a global ui script, but it is stuck in the page iFrame which is not the perfect solution.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 01 Feb 2017 13:27:26 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-include-a-javascript-library-within-the-servicenow-head/m-p/2070967#M727893</guid>
      <dc:creator>wolfgangb</dc:creator>
      <dc:date>2017-02-01T13:27:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to include a JavaScript library within the ServiceNow head tag?</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-include-a-javascript-library-within-the-servicenow-head/m-p/2070968#M727894</link>
      <description>&lt;P&gt;Hi Chuck,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Any ideas on that?&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Wolfgang&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 03 Feb 2017 07:16:29 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-include-a-javascript-library-within-the-servicenow-head/m-p/2070968#M727894</guid>
      <dc:creator>wolfgangb</dc:creator>
      <dc:date>2017-02-03T07:16:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to include a JavaScript library within the ServiceNow head tag?</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-include-a-javascript-library-within-the-servicenow-head/m-p/2070969#M727895</link>
      <description>&lt;P&gt;No ideas at this time. Perhaps someone else in the community can jump in.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 03 Feb 2017 13:52:08 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-include-a-javascript-library-within-the-servicenow-head/m-p/2070969#M727895</guid>
      <dc:creator>Chuck Tomasi</dc:creator>
      <dc:date>2017-02-03T13:52:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to include a JavaScript library within the ServiceNow head tag?</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-include-a-javascript-library-within-the-servicenow-head/m-p/2070970#M727896</link>
      <description>&lt;P&gt;If you place something like below in a UI script and make that global should work.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;(function(){&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; var top = getTopWindow().window.document.querySelector('head'); &amp;nbsp; // reach out to the parent window and get the head element&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; var script = document.createElement('script'); &amp;nbsp; //create a new script element&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; script.src = 'path/to/js/library'; &amp;nbsp; //sets the src attribute &lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; script.type = 'text/javascript'; &amp;nbsp; //sets the type attribute&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; top.appendChild(script); &amp;nbsp; &amp;nbsp; // appends the newly created script element at the end of the top window head element&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;})();&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="topWindow.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/63237iE1A78C3AAB352AB5/image-size/large?v=v2&amp;amp;px=999" srcset="/community/image/serverpage/image-id/63237iE1A78C3AAB352AB5/image-size/large?v=v2&amp;amp;px=999 1.0x" role="button" title="topWindow.png" alt="topWindow.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 03 Feb 2017 16:28:59 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-include-a-javascript-library-within-the-servicenow-head/m-p/2070970#M727896</guid>
      <dc:creator>ChrisBurks</dc:creator>
      <dc:date>2017-02-03T16:28:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to include a JavaScript library within the ServiceNow head tag?</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-include-a-javascript-library-within-the-servicenow-head/m-p/2070971#M727897</link>
      <description>&lt;P&gt;Hi ChrisB,&lt;/P&gt;
&lt;P&gt;I tried to use the function but I get 'Uncaught ReferenceError: getTopWindow is not defined' error. Am I doing something wrong? I am on Kingston patch 4.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;var top = getTopWindow().window.document.querySelector('head');&amp;nbsp; &amp;nbsp;// reach out to the parent window and get the head element&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jul 2018 16:11:23 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-include-a-javascript-library-within-the-servicenow-head/m-p/2070971#M727897</guid>
      <dc:creator>Ardeshna</dc:creator>
      <dc:date>2018-07-23T16:11:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to include a JavaScript library within the ServiceNow head tag?</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-include-a-javascript-library-within-the-servicenow-head/m-p/2070972#M727898</link>
      <description>&lt;P&gt;I tested on Kingston patch 6 and it works. I don't have a patch 4 environment to test on.&lt;/P&gt;
&lt;P&gt;Aside from that where exactly are you trying to use the this function?&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jul 2018 19:42:25 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-include-a-javascript-library-within-the-servicenow-head/m-p/2070972#M727898</guid>
      <dc:creator>ChrisBurks</dc:creator>
      <dc:date>2018-07-23T19:42:25Z</dc:date>
    </item>
  </channel>
</rss>

