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

Great! Go ahead and mark it answered


Please make sure if you set any UI script as Global, then the entire script will run on onload of all the pages in the servicenow.



Check twice before making as global since this will leads to affect your entire instance.



Thanks


Anish