How to use - JQuery in UI Page?

goswami_sudipta
Mega Expert

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

1 ACCEPTED SOLUTION

adiddigi
Tera Guru

use $j   - you don't have to include any library from Eureka. jQuery is globally loaded.


View solution in original post

6 REPLIES 6

kumaril1
Giga Expert

below is one of example of jquery in servicenow



<?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="jquery.min.jsdbx" />


<g:requires name="jquery.bxslider.min.jsdbx" />


<script>


$j(document).ready(function(){


  $j("p").click(function(){


        $j(this).hide();


      });


});


</script>


<p>If you click on me, I will disappear.</p>


<p>Click me away!</p>


<p>Click me too!</p>


</j:jelly>


jamieliao
Tera Contributor

Thanks for this post, recently tried jquery in CMS, works fine!