sample example for script include call from client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-26-2015 02:56 AM
Hi i am new to service now i want to use script include in client script please help me.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-26-2015 02:58 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-23-2018 12:12 AM
Hi Pradeep,
i need some examples of Script include without using return.
1.how can i call both server side Script Include and Client side include on Client Script (server side code and client callable code at client script).
2. I need atleast One example of both client callable Script include and Server side Script include.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-26-2015 03:11 AM
Hi,
Its almost the same in WIKI.
Create a client script and add the below code. when the client script will run user ID will be alerted.
var ga = new GlideAjax('UserID');
ga.addParam('sysparm_name','loginuser');
ga.getXML(myid);
function myid(response) {
var answer = response.responseXML.documentElement.getAttribute("answer");
alert(answer);
}
Create a Scrite include with name UserID and check true client.
add the below code.
var UserID = Class.create();
UserID.prototype = Object.extendsObject(AbstractAjaxProcessor, {
loginuser: function() {
return gs.getUserID();
},
});
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-27-2018 10:37 PM
Hi,
Can you please explain the below line of code mentioned in Client Script.
" var answer = response.responseXML.documentElement.getAttribute("answer");"
Thanks,
Kuchi