- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2015 06:34 PM
Hello—
Have anyone used JQuery in an UI Page or UI Macro? I would like to understand if there is any plugin which needs to enable to use JQuery; or while creating an UI Page/UI Macro, do I need to include any external link for JQuery?
Please help me out. If you can provide me with an example, that would be much helpful.
Thank you!
Sudipta
CHHAVI SHAHBrad Tilton (Cloud Sherpas)Jim Coyne
Solved! Go to Solution.
- Labels:
-
User Interface (UI)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2015 08:04 PM
use $j - you don't have to include any library from Eureka. jQuery is globally loaded.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2015 08:04 PM
use $j - you don't have to include any library from Eureka. jQuery is globally loaded.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2022 10:52 PM
I just removed this script from the HTML.
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
then use $j instead of $ for the client script and it is now working both in the form and in the UI page. Thanks a lot!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2015 02:52 AM
Hi,
Tyler Jones created an excellent article about this: http://jylertones.com/blog/2013/05/the-right-way-to-use-jquery-with-servicenow/
Important is the explaination on $j
Basically, you can add the jquery version that ships with servicenow or you can include you're own
ServicenNow version:
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="true" xmlns:j="jelly:core" xmlns:g="glide" xmlns:g2="null" xmlns:j2="null">
<g:requires name="scripts/lib/jquery_includes.js"/>
</j:jelly>
Own version:
Create scripts as UI scripts, then reference from within UI page or in this case i reference the ones hosted at jquery.com
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<meta charset="utf-8"></meta>
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.0/themes/smoothness/jquery-ui.css"></link>
<script></script>
<script></script>
...
</j:jelly>
Raymond

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2015 03:43 AM
As abhiram says $j should work out of the box.. Checked that already ? If you want some extra jQuery plugins, follow the approach suggested by Raymond