How can I access jQuery from a Client Script

brandon_chamber
Kilo Contributor

Hello,

 

I've got a "Client Script" from which I'd like to access jQuery functionality.   How can I do this?   This is a normal ServiceNow client script, so I am already in an onChange() or onLoad() function and am not able to use the <g:include /> construct as this is not a UI page.   I see from inspecting the ServiceNow page that it looks like ServiceNow has setup a javascript include of <script></script> but when I try to reference window.jQuery or $j, I'm getting an undefined error.

 

Any sight to this would be helpful.

 

Thanks,

 

Brandon

11 REPLIES 11

Hi Geoff,



Can you please guide me where can i find this UI Script "jquery.min". i couldn't find this in my UI Scripts.


can you please give me UI Script Name?



Thanks,


Pavan.


Hi pavan kumar you can refer to this post to bring the jquery.min   library as a UI script



No no, what you are trying


Hi Mahira,


I have requirement to find on click event with jquery in my client script as below              


$j("a[data-type='reference_popup']").click(function( event ) {


//My code here


});



But above statement with '$j'   is not working in my client script. so i thought to make "jquery.min" UI script as global if its not.



Please guide me on this.



Thanks in Advance,


Pavan.


jeff_lord
Giga Contributor

Have you been able to figure this out?


Yes for what i needed.



THanks,



Brandon Chambers


PAD Programming Team