Adding an external jQuery Library to Service Portal/ServiceNow instance

nicksoltis
Kilo Expert

Hello community,

How can I add an external jQuery library to use in the service portal? I would like to play around with the jQuery UI (user interface) library to play around with the cool animations offered.


The link for this library is below:

https://code.jquery.com/ui/1.12.1/jquery-ui.js

Please let me know if this is possible.

Thanks,

Nick

5 REPLIES 5

Gurpreet07
Mega Sage

Hi Nicholas,



Go to Service Portal --> Dependencies       from left nav. Open any dependency and there will be related lists to include any js / Css and refer to your portal.


Am I doing something wrong?


Link to example:


http://jqueryui.com/draggable/


Links they include in the link demo example:


        - //code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css


        - /resources/demos/style.css


        - https://code.jquery.com/jquery-1.12.4.js


        - https://code.jquery.com/ui/1.12.1/jquery-ui.js



THIS IS WHAT I HAVE


-------------------------------------------------------------


Code in widget editor:


Screen Shot 2017-01-18 at 2.54.42 AM.png


Result:


Screen Shot 2017-01-18 at 2.57.04 AM.png


New dependency I've (JS) created :


Screen Shot 2017-01-18 at 2.59.06 AM.png


(css):


Screen Shot 2017-01-18 at 3.00.25 AM.png


jquery needs to load before jquery ui.



Looks like you need to change the order for jquery ui to 200, currently they are both at 100.


Hi Nicholas, nicksoltis



Have you figured it out? Im facing the same issue.Please let me know how to use jquery in portal.



I have added the jquery code to link area and have included the dependencies still couldn't get what I want.





Thank you in advance!!