Can we use jQuery in ServiceNow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-14-2015 07:52 PM
Hi All,
I am just a starter in ServiceNow. Want to know if we can use jQuery in ServiceNow where ever we can use Javascript?
If yes..... Please let me know the whole procedure.
- Labels:
-
Service Mapping
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-14-2015 11:18 PM
Yes.. you can. The following URLs should guide you further
http://jylertones.com/blog/2013/05/the-right-way-to-use-jquery-with-servicenow/
Integrate ServiceNow with jQuery | Constantine's thoughts
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-17-2015 07:24 PM
Hi Probir Das,
Thanks for your reply.
I tried grasping things in both the articles and end up with nothing.
Can you please tell me what should I do in order to run the below code successfully in Client Script?
$(document).ready(function(){
$("p").click(function(){
$(this).hide();
});
});
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-19-2015 04:44 PM
Any luck?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-05-2015 06:41 PM
Hi All,
Here is the solution.
I have successfully implemented your code in a Client Script as detailed below:
- In your test instance, access:
System Definition -> Client Scripts
- Click "New"
- Fill in the form as follows:
* Enter a name (I used jQueryTest)
* Select "Incident" table
* Type: onLoad
* Global and Active ticked
* Script:
function onLoad() {
//Type appropriate comment here, and begin script below
var $j = jQuery.noConflict(true);
$j(document).ready(function(){
$j("p").click(function(){
$j(this).hide();
});
});
}
- Click Save
- Open any incident and enter a comment as below:
(Please remove the underscore _ from both code tags, I had to include it to ensure it is formatted correctly)
[co_de]
<p>test</p>
[/co_de]
- Click the "test" comment to see it disappear.